diff options
author | Evan Cheng <evan.cheng@apple.com> | 2008-08-30 09:07:18 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2008-08-30 09:07:18 +0000 |
commit | 542ac629713189bb5b541492b8b95d5061b9a7c0 (patch) | |
tree | 86a93fa585620532e2681a61ccd1295a6cb14143 /llvm/lib | |
parent | b8d588d89c0fc8d305f968069aff743b0e61d8f5 (diff) | |
download | bcm5719-llvm-542ac629713189bb5b541492b8b95d5061b9a7c0.tar.gz bcm5719-llvm-542ac629713189bb5b541492b8b95d5061b9a7c0.zip |
Fold isRematerializable checks into isSafeToReMat.
llvm-svn: 55563
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/CodeGen/MachineInstr.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/MachineInstr.cpp b/llvm/lib/CodeGen/MachineInstr.cpp index 0b1afa3f096..ce5c5235b82 100644 --- a/llvm/lib/CodeGen/MachineInstr.cpp +++ b/llvm/lib/CodeGen/MachineInstr.cpp @@ -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); |