Machine LICM increases register pressure and it almost always increase code size...
authorEvan Cheng <evan.cheng@apple.com>
Thu, 5 Feb 2009 08:51:13 +0000 (08:51 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Thu, 5 Feb 2009 08:51:13 +0000 (08:51 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63856 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/MachineLICM.cpp

index 76d5f377949bcded755ddf987fb82c8da40b2bd2..dd32977f90b6c6f6a8ec9b8ec38664b4a8097339 100644 (file)
@@ -126,6 +126,10 @@ static bool LoopIsOuterMostWithPreheader(MachineLoop *CurLoop) {
 /// loop.
 ///
 bool MachineLICM::runOnMachineFunction(MachineFunction &MF) {
+  const Function *F = MF.getFunction();
+  if (F->hasFnAttr(Attribute::OptimizeForSize))
+    return false;
+
   DOUT << "******** Machine LICM ********\n";
 
   Changed = false;