Fold isRematerializable checks into isSafeToReMat.

llvm-svn: 55563
This commit is contained in:
Evan Cheng 2008-08-30 09:07:18 +00:00
parent b8d588d89c
commit 542ac62971
1 changed files with 3 additions and 1 deletions

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);