mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-28 21:34:23 +00:00
Migrate CodeGenPrepare to use the Function based getSubtarget
code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227157 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
cdafa1003b
commit
24f37da028
@ -211,7 +211,7 @@ bool CodeGenPrepare::runOnFunction(Function &F) {
|
|||||||
|
|
||||||
ModifiedDT = false;
|
ModifiedDT = false;
|
||||||
if (TM)
|
if (TM)
|
||||||
TLI = TM->getSubtargetImpl()->getTargetLowering();
|
TLI = TM->getSubtargetImpl(F)->getTargetLowering();
|
||||||
TLInfo = &getAnalysis<TargetLibraryInfoWrapperPass>().getTLI();
|
TLInfo = &getAnalysis<TargetLibraryInfoWrapperPass>().getTLI();
|
||||||
TTI = &getAnalysis<TargetTransformInfo>();
|
TTI = &getAnalysis<TargetTransformInfo>();
|
||||||
DominatorTreeWrapperPass *DTWP =
|
DominatorTreeWrapperPass *DTWP =
|
||||||
@ -3143,8 +3143,10 @@ bool CodeGenPrepare::OptimizeMemoryInst(Instruction *MemoryInst, Value *Addr,
|
|||||||
<< *MemoryInst << "\n");
|
<< *MemoryInst << "\n");
|
||||||
if (SunkAddr->getType() != Addr->getType())
|
if (SunkAddr->getType() != Addr->getType())
|
||||||
SunkAddr = Builder.CreateBitCast(SunkAddr, Addr->getType());
|
SunkAddr = Builder.CreateBitCast(SunkAddr, Addr->getType());
|
||||||
} else if (AddrSinkUsingGEPs || (!AddrSinkUsingGEPs.getNumOccurrences() &&
|
} else if (AddrSinkUsingGEPs ||
|
||||||
TM && TM->getSubtarget<TargetSubtargetInfo>().useAA())) {
|
(!AddrSinkUsingGEPs.getNumOccurrences() && TM &&
|
||||||
|
TM->getSubtarget<TargetSubtargetInfo>(
|
||||||
|
MemoryInst->getParent()->getParent()).useAA())) {
|
||||||
// By default, we use the GEP-based method when AA is used later. This
|
// By default, we use the GEP-based method when AA is used later. This
|
||||||
// prevents new inttoptr/ptrtoint pairs from degrading AA capabilities.
|
// prevents new inttoptr/ptrtoint pairs from degrading AA capabilities.
|
||||||
DEBUG(dbgs() << "CGP: SINKING nonlocal addrmode: " << AddrMode << " for "
|
DEBUG(dbgs() << "CGP: SINKING nonlocal addrmode: " << AddrMode << " for "
|
||||||
|
Loading…
x
Reference in New Issue
Block a user