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.

llvm-svn: 227172

llvm/lib/Transforms/Scalar/SeparateConstOffsetFromGEP.cpp

index 6157746..0c70d0f 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);