[llvm-commits] [llvm] r55563 - /llvm/trunk/lib/CodeGen/MachineInstr.cpp

Evan Cheng evan.cheng at apple.com
Sat Aug 30 02:07:19 PDT 2008


Author: evancheng
Date: Sat Aug 30 04:07:18 2008
New Revision: 55563

URL: http://llvm.org/viewvc/llvm-project?rev=55563&view=rev
Log:
Fold isRematerializable checks into isSafeToReMat.

Modified:
    llvm/trunk/lib/CodeGen/MachineInstr.cpp

Modified: llvm/trunk/lib/CodeGen/MachineInstr.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineInstr.cpp?rev=55563&r1=55562&r2=55563&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/MachineInstr.cpp (original)
+++ llvm/trunk/lib/CodeGen/MachineInstr.cpp Sat Aug 30 04:07:18 2008
@@ -715,7 +715,9 @@
 /// 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);





More information about the llvm-commits mailing list