diff options
| author | Dan Gohman <gohman@apple.com> | 2008-06-09 22:05:52 +0000 |
|---|---|---|
| committer | Dan Gohman <gohman@apple.com> | 2008-06-09 22:05:52 +0000 |
| commit | e38cc012445e4f9bcf1d753a349f676b217c6885 (patch) | |
| tree | 85b55c6066696a1485f20db014eaffb69cc8ef79 /llvm/lib/CodeGen | |
| parent | 27ae953278dba7074903d71442c34f57b9a551f6 (diff) | |
| download | bcm5719-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.cpp | 4 |
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; } |

