forked from OSchip/llvm-project
parent
ce4f31d3ce
commit
985a0b51d7
|
|
@ -794,7 +794,7 @@ bool LiveIntervals::tryFoldMemoryOperand(MachineInstr* &MI,
|
||||||
/// folding is possible.
|
/// folding is possible.
|
||||||
bool LiveIntervals::canFoldMemoryOperand(MachineInstr *MI,
|
bool LiveIntervals::canFoldMemoryOperand(MachineInstr *MI,
|
||||||
SmallVector<unsigned, 2> &Ops,
|
SmallVector<unsigned, 2> &Ops,
|
||||||
bool ReMatLoad) const {
|
bool ReMat) const {
|
||||||
// Filter the list of operand indexes that are to be folded. Abort if
|
// Filter the list of operand indexes that are to be folded. Abort if
|
||||||
// any operand will prevent folding.
|
// any operand will prevent folding.
|
||||||
unsigned MRInfo = 0;
|
unsigned MRInfo = 0;
|
||||||
|
|
@ -802,8 +802,8 @@ bool LiveIntervals::canFoldMemoryOperand(MachineInstr *MI,
|
||||||
if (FilterFoldedOps(MI, Ops, MRInfo, FoldOps))
|
if (FilterFoldedOps(MI, Ops, MRInfo, FoldOps))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// Can't fold a remat'ed load into a two address instruction.
|
// It's only legal to remat for a use, not a def.
|
||||||
if (ReMatLoad && (MRInfo & VirtRegMap::isMod))
|
if (ReMat && (MRInfo & VirtRegMap::isMod))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return tii_->canFoldMemoryOperand(MI, FoldOps);
|
return tii_->canFoldMemoryOperand(MI, FoldOps);
|
||||||
|
|
@ -947,7 +947,7 @@ rewriteInstructionForSpills(const LiveInterval &li, const VNInfo *VNI,
|
||||||
goto RestartInstruction;
|
goto RestartInstruction;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
CanFold = canFoldMemoryOperand(MI, Ops, DefIsReMat && isLoad);
|
CanFold = canFoldMemoryOperand(MI, Ops, DefIsReMat);
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
CanFold = false;
|
CanFold = false;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue