[llvm-commits] [llvm] r52158 -	/llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp
    Dan Gohman 
    gohman at apple.com
       
    Mon Jun  9 15:05:52 PDT 2008
    
    
  
Author: djg
Date: Mon Jun  9 17:05:52 2008
New Revision: 52158
URL: http://llvm.org/viewvc/llvm-project?rev=52158&view=rev
Log:
Teach isGAPlusOffset to respect a GlobalAddressSDNode's offset
value, which is something that apparently isn't used much.
Modified:
    llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp?rev=52158&r1=52157&r2=52158&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp Mon Jun  9 17:05:52 2008
@@ -1487,7 +1487,9 @@
 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;
   }
 
    
    
More information about the llvm-commits
mailing list