aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-12-18 07:09:06 +0000
committerChris Lattner <sabre@nondot.org>2005-12-18 07:09:06 +0000
commitd5aae0528132a130e2d8069c3deebe7e6a362759 (patch)
tree8f756f043938bbe23c0aa63d8462c2ccdd550a99
parent737f631532f98376cc8890e0f82f050a1da3aa8a (diff)
simplifications, fix typo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24820 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Target/Sparc/SparcISelDAGToDAG.cpp11
-rw-r--r--lib/Target/SparcV8/SparcV8ISelDAGToDAG.cpp11
2 files changed, 10 insertions, 12 deletions
diff --git a/lib/Target/Sparc/SparcISelDAGToDAG.cpp b/lib/Target/Sparc/SparcISelDAGToDAG.cpp
index 751a8e2b1a..e4b2e1aaa8 100644
--- a/lib/Target/Sparc/SparcISelDAGToDAG.cpp
+++ b/lib/Target/Sparc/SparcISelDAGToDAG.cpp
@@ -350,9 +350,8 @@ void SparcV8DAGToDAGISel::InstructionSelectBasicBlock(SelectionDAG &DAG) {
bool SparcV8DAGToDAGISel::SelectADDRri(SDOperand Addr, SDOperand &Base,
SDOperand &Offset) {
- if (Addr.getOpcode() == ISD::FrameIndex) {
- int FI = cast<FrameIndexSDNode>(Addr)->getIndex();
- Base = CurDAG->getTargetFrameIndex(FI, MVT::i32);
+ if (FrameIndexSDNode *FIN = dyn_cast<FrameIndexSDNode>(Addr)) {
+ Base = CurDAG->getTargetFrameIndex(FIN->getIndex(), MVT::i32);
Offset = CurDAG->getTargetConstant(0, MVT::i32);
return true;
}
@@ -360,10 +359,10 @@ bool SparcV8DAGToDAGISel::SelectADDRri(SDOperand Addr, SDOperand &Base,
if (Addr.getOpcode() == ISD::ADD) {
if (ConstantSDNode *CN = dyn_cast<ConstantSDNode>(Addr.getOperand(1))) {
if (Predicate_simm13(CN)) {
- if (Addr.getOperand(0).getOpcode() == ISD::FrameIndex) {
+ if (FrameIndexSDNode *FIN =
+ dyn_cast<FrameIndexSDNode>(Addr.getOperand(0))) {
// Constant offset from frame ref.
- int FI = cast<FrameIndexSDNode>(Addr)->getIndex();
- Base = CurDAG->getTargetFrameIndex(FI, MVT::i32);
+ Base = CurDAG->getTargetFrameIndex(FIN->getIndex(), MVT::i32);
} else {
Base = Select(Addr.getOperand(0));
}
diff --git a/lib/Target/SparcV8/SparcV8ISelDAGToDAG.cpp b/lib/Target/SparcV8/SparcV8ISelDAGToDAG.cpp
index 751a8e2b1a..e4b2e1aaa8 100644
--- a/lib/Target/SparcV8/SparcV8ISelDAGToDAG.cpp
+++ b/lib/Target/SparcV8/SparcV8ISelDAGToDAG.cpp
@@ -350,9 +350,8 @@ void SparcV8DAGToDAGISel::InstructionSelectBasicBlock(SelectionDAG &DAG) {
bool SparcV8DAGToDAGISel::SelectADDRri(SDOperand Addr, SDOperand &Base,
SDOperand &Offset) {
- if (Addr.getOpcode() == ISD::FrameIndex) {
- int FI = cast<FrameIndexSDNode>(Addr)->getIndex();
- Base = CurDAG->getTargetFrameIndex(FI, MVT::i32);
+ if (FrameIndexSDNode *FIN = dyn_cast<FrameIndexSDNode>(Addr)) {
+ Base = CurDAG->getTargetFrameIndex(FIN->getIndex(), MVT::i32);
Offset = CurDAG->getTargetConstant(0, MVT::i32);
return true;
}
@@ -360,10 +359,10 @@ bool SparcV8DAGToDAGISel::SelectADDRri(SDOperand Addr, SDOperand &Base,
if (Addr.getOpcode() == ISD::ADD) {
if (ConstantSDNode *CN = dyn_cast<ConstantSDNode>(Addr.getOperand(1))) {
if (Predicate_simm13(CN)) {
- if (Addr.getOperand(0).getOpcode() == ISD::FrameIndex) {
+ if (FrameIndexSDNode *FIN =
+ dyn_cast<FrameIndexSDNode>(Addr.getOperand(0))) {
// Constant offset from frame ref.
- int FI = cast<FrameIndexSDNode>(Addr)->getIndex();
- Base = CurDAG->getTargetFrameIndex(FI, MVT::i32);
+ Base = CurDAG->getTargetFrameIndex(FIN->getIndex(), MVT::i32);
} else {
Base = Select(Addr.getOperand(0));
}