Eliminate LegalizeOps' LegalizedNodes map and have it just call RAUW
[oota-llvm.git] / lib / Target / XCore / XCoreISelLowering.cpp
index 2afe0e35afb1b282a5f2e901319ff845915710ad..4b74f960474ab75076bbfa5c1fb3deee4b571d99 100644 (file)
@@ -386,6 +386,15 @@ IsWordAlignedBasePlusConstantOffset(SDValue Addr, SDValue &AlignedBase,
     Offset = off;
     return true;
   }
+  // Check for an aligned global variable.
+  if (GlobalAddressSDNode *GA = dyn_cast<GlobalAddressSDNode>(*Root)) {
+    const GlobalValue *GV = GA->getGlobal();
+    if (GA->getOffset() == 0 && GV->getAlignment() >= 4) {
+      AlignedBase = Base;
+      Offset = off;
+      return true;
+    }
+  }
   return false;
 }