Migrate SeparateConstOffsetFromGEP to use a Function with
authorEric Christopher <echristo@gmail.com>
Tue, 27 Jan 2015 07:16:37 +0000 (07:16 +0000)
committerEric Christopher <echristo@gmail.com>
Tue, 27 Jan 2015 07:16:37 +0000 (07:16 +0000)
getSubtarget.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227172 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Scalar/SeparateConstOffsetFromGEP.cpp

index 6157746af48c2d31ff254e1c1222252b2a0ef065..0c70d0faaa13af2e7fcf2b0fdc2710f675ec572a 100644 (file)
@@ -910,7 +910,7 @@ bool SeparateConstOffsetFromGEP::splitGEP(GetElementPtrInst *GEP) {
   if (LowerGEP) {
     // As currently BasicAA does not analyze ptrtoint/inttoptr, do not lower to
     // arithmetic operations if the target uses alias analysis in codegen.
-    if (TM && TM->getSubtarget<TargetSubtargetInfo>().useAA())
+    if (TM && TM->getSubtargetImpl(*GEP->getParent()->getParent())->useAA())
       lowerToSingleIndexGEPs(GEP, AccumulativeByteOffset);
     else
       lowerToArithmetics(GEP, AccumulativeByteOffset);