From 740854bb1974642af77bec5e7f835e15115ad639 Mon Sep 17 00:00:00 2001 From: Evan Cheng Date: Thu, 5 Feb 2009 08:51:13 +0000 Subject: [PATCH] Machine LICM increases register pressure and it almost always increase code size. For now, disable it for optimizing for size. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63856 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/MachineLICM.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/CodeGen/MachineLICM.cpp b/lib/CodeGen/MachineLICM.cpp index 76d5f377949..dd32977f90b 100644 --- a/lib/CodeGen/MachineLICM.cpp +++ b/lib/CodeGen/MachineLICM.cpp @@ -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;