[llvm-commits] [llvm] r83671 - in /llvm/trunk/lib/CodeGen: LiveIntervalAnalysis.cpp MachineInstr.cpp MachineLICM.cpp SimpleRegisterCoalescing.cpp

Dan Gohman gohman at apple.com
Fri Oct 9 14:02:10 PDT 2009


Author: djg
Date: Fri Oct  9 16:02:10 2009
New Revision: 83671

URL: http://llvm.org/viewvc/llvm-project?rev=83671&view=rev
Log:
isTriviallyReMaterializable checks the
TargetInstrDesc::isRematerializable flag, so it isn't necessary to do
this check in its callers.

Modified:
    llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp
    llvm/trunk/lib/CodeGen/MachineInstr.cpp
    llvm/trunk/lib/CodeGen/MachineLICM.cpp
    llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp

Modified: llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp?rev=83671&r1=83670&r2=83671&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp (original)
+++ llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp Fri Oct  9 16:02:10 2009
@@ -1423,8 +1423,7 @@
   // If the target-specific rules don't identify an instruction as
   // being trivially rematerializable, use some target-independent
   // rules.
-  if (!MI->getDesc().isRematerializable() ||
-      !tii_->isTriviallyReMaterializable(MI)) {
+  if (!tii_->isTriviallyReMaterializable(MI)) {
     if (!EnableAggressiveRemat)
       return false;
 

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

==============================================================================
--- llvm/trunk/lib/CodeGen/MachineInstr.cpp (original)
+++ llvm/trunk/lib/CodeGen/MachineInstr.cpp Fri Oct  9 16:02:10 2009
@@ -960,8 +960,7 @@
 bool MachineInstr::isSafeToReMat(const TargetInstrInfo *TII,
                                  unsigned DstReg) const {
   bool SawStore = false;
-  if (!getDesc().isRematerializable() ||
-      !TII->isTriviallyReMaterializable(this) ||
+  if (!TII->isTriviallyReMaterializable(this) ||
       !isSafeToMove(TII, SawStore))
     return false;
   for (unsigned i = 0, e = getNumOperands(); i != e; ++i) {

Modified: llvm/trunk/lib/CodeGen/MachineLICM.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineLICM.cpp?rev=83671&r1=83670&r2=83671&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/MachineLICM.cpp (original)
+++ llvm/trunk/lib/CodeGen/MachineLICM.cpp Fri Oct  9 16:02:10 2009
@@ -322,7 +322,7 @@
   // FIXME: For now, only hoist re-materilizable instructions. LICM will
   // increase register pressure. We want to make sure it doesn't increase
   // spilling.
-  if (!TID.isRematerializable() || !TII->isTriviallyReMaterializable(&MI))
+  if (!TII->isTriviallyReMaterializable(&MI))
     return false;
 
   // If result(s) of this instruction is used by PHIs, then don't hoist it.

Modified: llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp?rev=83671&r1=83670&r2=83671&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp (original)
+++ llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp Fri Oct  9 16:02:10 2009
@@ -646,8 +646,7 @@
   const TargetInstrDesc &TID = DefMI->getDesc();
   if (!TID.isAsCheapAsAMove())
     return false;
-  if (!DefMI->getDesc().isRematerializable() ||
-      !tii_->isTriviallyReMaterializable(DefMI))
+  if (!tii_->isTriviallyReMaterializable(DefMI))
     return false;
   bool SawStore = false;
   if (!DefMI->isSafeToMove(tii_, SawStore))





More information about the llvm-commits mailing list