[llvm-commits] [llvm] r63729 - /llvm/trunk/lib/CodeGen/MachineLICM.cpp

Evan Cheng evan.cheng at apple.com
Wed Feb 4 01:21:58 PST 2009


Author: evancheng
Date: Wed Feb  4 03:21:58 2009
New Revision: 63729

URL: http://llvm.org/viewvc/llvm-project?rev=63729&view=rev
Log:
Don't call isInvariantLoad twice.

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

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

==============================================================================
--- llvm/trunk/lib/CodeGen/MachineLICM.cpp (original)
+++ llvm/trunk/lib/CodeGen/MachineLICM.cpp Wed Feb  4 03:21:58 2009
@@ -276,18 +276,11 @@
 bool MachineLICM::IsProfitableToHoist(MachineInstr &MI) {
   const TargetInstrDesc &TID = MI.getDesc();
 
-  bool isInvLoad = false;
-  if (TID.mayLoad()) {
-    isInvLoad = TII->isInvariantLoad(&MI);
-    if (!isInvLoad)
-      return false;
-  }
-
   // FIXME: For now, only hoist re-materilizable instructions. LICM will
   // increase register pressure. We want to make sure it doesn't increase
   // spilling.
-  if (!isInvLoad && (!TID.isRematerializable() ||
-                     !TII->isTriviallyReMaterializable(&MI)))
+  if (!TID.mayLoad() && (!TID.isRematerializable() ||
+                         !TII->isTriviallyReMaterializable(&MI)))
     return false;
 
   if (!TID.isAsCheapAsAMove())





More information about the llvm-commits mailing list