From 078ac6071d0129a4769ab248dbc65cc4763fea4e 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. llvm-svn: 63856 --- 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;