Fold isRematerializable checks into isSafeToReMat.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55563 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Evan Cheng 2008-08-30 09:07:18 +00:00
parent b18ae3cb63
commit 3689ff450a

View File

@ -715,7 +715,9 @@ bool MachineInstr::isSafeToMove(const TargetInstrInfo *TII, bool &SawStore) {
/// instruction which defined the specified register instead of copying it.
bool MachineInstr::isSafeToReMat(const TargetInstrInfo *TII, unsigned DstReg) {
bool SawStore = false;
if (!isSafeToMove(TII, SawStore))
if (!getDesc().isRematerializable() ||
!TII->isTriviallyReMaterializable(this) ||
!isSafeToMove(TII, SawStore))
return false;
for (unsigned i = 0, e = getNumOperands(); i != e; ++i) {
MachineOperand &MO = getOperand(i);