summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2008-06-09 22:05:52 +0000
committerDan Gohman <gohman@apple.com>2008-06-09 22:05:52 +0000
commite38cc012445e4f9bcf1d753a349f676b217c6885 (patch)
tree85b55c6066696a1485f20db014eaffb69cc8ef79 /llvm/lib/CodeGen
parent27ae953278dba7074903d71442c34f57b9a551f6 (diff)
downloadbcm5719-llvm-e38cc012445e4f9bcf1d753a349f676b217c6885.tar.gz
bcm5719-llvm-e38cc012445e4f9bcf1d753a349f676b217c6885.zip
Teach isGAPlusOffset to respect a GlobalAddressSDNode's offset
value, which is something that apparently isn't used much. llvm-svn: 52158
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
index fe752de6445..c99319338e3 100644
--- a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
@@ -1487,7 +1487,9 @@ TargetLowering::SimplifySetCC(MVT VT, SDOperand N0, SDOperand N1,
bool TargetLowering::isGAPlusOffset(SDNode *N, GlobalValue* &GA,
int64_t &Offset) const {
if (isa<GlobalAddressSDNode>(N)) {
- GA = cast<GlobalAddressSDNode>(N)->getGlobal();
+ GlobalAddressSDNode *GASD = cast<GlobalAddressSDNode>(N);
+ GA = GASD->getGlobal();
+ Offset += GASD->getOffset();
return true;
}
OpenPOWER on IntegriCloud