[llvm] r227157 - Migrate CodeGenPrepare to use the Function based getSubtarget
Eric Christopher
echristo at gmail.com
Mon Jan 26 17:01:38 PST 2015
Author: echristo
Date: Mon Jan 26 19:01:38 2015
New Revision: 227157
URL: http://llvm.org/viewvc/llvm-project?rev=227157&view=rev
Log:
Migrate CodeGenPrepare to use the Function based getSubtarget
code.
Modified:
llvm/trunk/lib/CodeGen/CodeGenPrepare.cpp
Modified: llvm/trunk/lib/CodeGen/CodeGenPrepare.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/CodeGenPrepare.cpp?rev=227157&r1=227156&r2=227157&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/CodeGenPrepare.cpp (original)
+++ llvm/trunk/lib/CodeGen/CodeGenPrepare.cpp Mon Jan 26 19:01:38 2015
@@ -211,7 +211,7 @@ bool CodeGenPrepare::runOnFunction(Funct
ModifiedDT = false;
if (TM)
- TLI = TM->getSubtargetImpl()->getTargetLowering();
+ TLI = TM->getSubtargetImpl(F)->getTargetLowering();
TLInfo = &getAnalysis<TargetLibraryInfoWrapperPass>().getTLI();
TTI = &getAnalysis<TargetTransformInfo>();
DominatorTreeWrapperPass *DTWP =
@@ -3143,8 +3143,10 @@ bool CodeGenPrepare::OptimizeMemoryInst(
<< *MemoryInst << "\n");
if (SunkAddr->getType() != Addr->getType())
SunkAddr = Builder.CreateBitCast(SunkAddr, Addr->getType());
- } else if (AddrSinkUsingGEPs || (!AddrSinkUsingGEPs.getNumOccurrences() &&
- TM && TM->getSubtarget<TargetSubtargetInfo>().useAA())) {
+ } else if (AddrSinkUsingGEPs ||
+ (!AddrSinkUsingGEPs.getNumOccurrences() && TM &&
+ TM->getSubtarget<TargetSubtargetInfo>(
+ MemoryInst->getParent()->getParent()).useAA())) {
// By default, we use the GEP-based method when AA is used later. This
// prevents new inttoptr/ptrtoint pairs from degrading AA capabilities.
DEBUG(dbgs() << "CGP: SINKING nonlocal addrmode: " << AddrMode << " for "
More information about the llvm-commits
mailing list