[llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp
Chris Lattner
sabre at nondot.org
Tue Oct 31 12:02:10 PST 2006
Changes in directory llvm/lib/CodeGen/SelectionDAG:
ScheduleDAG.cpp updated: 1.104 -> 1.105
---
Log message:
handle global address constant sdnodes
---
Diffs of the changes: (+7 -2)
ScheduleDAG.cpp | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
Index: llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp:1.104 llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp:1.105
--- llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp:1.104 Sat Oct 14 03:34:06 2006
+++ llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp Tue Oct 31 14:01:56 2006
@@ -544,8 +544,13 @@
break;
case 3: { // Immediate.
assert(NumVals == 1 && "Unknown immediate value!");
- uint64_t Val = cast<ConstantSDNode>(Node->getOperand(i))->getValue();
- MI->addImmOperand(Val);
+ if (ConstantSDNode *CS=dyn_cast<ConstantSDNode>(Node->getOperand(i))){
+ MI->addImmOperand(CS->getValue());
+ } else {
+ GlobalAddressSDNode *GA =
+ cast<GlobalAddressSDNode>(Node->getOperand(i));
+ MI->addGlobalAddressOperand(GA->getGlobal(), GA->getOffset());
+ }
++i;
break;
}
More information about the llvm-commits
mailing list