summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-10-31 20:01:56 +0000
committerChris Lattner <sabre@nondot.org>2006-10-31 20:01:56 +0000
commit1fd360e13a6e06800b4f65b8607eeb4ab0f4df21 (patch)
treedcb561a65e82eba121244d9f01a2b877f88d179f /llvm/lib/CodeGen
parent8b20fa42dace77c5bddae44a167002b47bdf26d2 (diff)
downloadbcm5719-llvm-1fd360e13a6e06800b4f65b8607eeb4ab0f4df21.tar.gz
bcm5719-llvm-1fd360e13a6e06800b4f65b8607eeb4ab0f4df21.zip
handle global address constant sdnodes
llvm-svn: 31323
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp
index ad9bfefd2f3..cfc27a32d54 100644
--- a/llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp
@@ -544,8 +544,13 @@ void ScheduleDAG::EmitNode(SDNode *Node,
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;
}
OpenPOWER on IntegriCloud