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 | a07a9a214b371f0cbc62fe77941971a1ff5063b8 (patch) | |
tree | 61ce7f7eb623d650f990ca74116daf60c08b3554 /lib/CodeGen/MachineInstr.cpp | |
parent | 0685efabe108de50aa78542dd002612c8e00dabe (diff) | |
download | external_llvm-a07a9a214b371f0cbc62fe77941971a1ff5063b8.zip external_llvm-a07a9a214b371f0cbc62fe77941971a1ff5063b8.tar.gz external_llvm-a07a9a214b371f0cbc62fe77941971a1ff5063b8.tar.bz2 |
Fold isRematerializable checks into isSafeToReMat.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55563 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/MachineInstr.cpp')
-rw-r--r-- | lib/CodeGen/MachineInstr.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/CodeGen/MachineInstr.cpp b/lib/CodeGen/MachineInstr.cpp index 0b1afa3..ce5c523 100644 --- a/lib/CodeGen/MachineInstr.cpp +++ b/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); |