mirror of
https://github.com/RPCS3/llvm.git
synced 2025-02-07 02:56:52 +00:00
Reason #3 from 60595 doesn't hold true. If we can fold a PIC load from constpool into a use, the rewrite happens at time of spill (not in VirtRegMap). Later on, if the GlobalBaseReg is spilled, the spiller can see the use uses GlobalBaseReg and do the right thing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60596 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
84100ba83d
commit
650d7f3ff4
@ -2059,6 +2059,7 @@ addIntervalsForSpills(const LiveInterval &li,
|
||||
if (isLoadSS || ReMatDefMI->getDesc().canFoldAsLoad())
|
||||
Folded = tryFoldMemoryOperand(MI, vrm, ReMatDefMI, index,
|
||||
Ops, isLoadSS, LdSlot, VReg);
|
||||
if (!Folded) {
|
||||
unsigned ImpUse = getReMatImplicitUse(li, ReMatDefMI);
|
||||
if (ImpUse) {
|
||||
// Re-matting an instruction with virtual register use. Add the
|
||||
@ -2071,6 +2072,7 @@ addIntervalsForSpills(const LiveInterval &li,
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// If folding is not possible / failed, then tell the spiller to issue a
|
||||
// load / rematerialization for us.
|
||||
if (Folded)
|
||||
|
@ -2141,8 +2141,6 @@ MachineInstr* X86InstrInfo::foldMemoryOperandImpl(MachineFunction &MF,
|
||||
// This doesn't work for several reasons.
|
||||
// 1. GlobalBaseReg may have been spilled.
|
||||
// 2. It may not be live at MI.
|
||||
// 3. If this is used during register allocation / spilling, the spiller
|
||||
// must know not to spill GlobalBaseReg (which is a temporary nasty hack).
|
||||
return false;
|
||||
|
||||
// Create a v4i32 constant-pool entry.
|
||||
|
Loading…
x
Reference in New Issue
Block a user