aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2009-02-05 08:51:13 +0000
committerEvan Cheng <evan.cheng@apple.com>2009-02-05 08:51:13 +0000
commit740854bb1974642af77bec5e7f835e15115ad639 (patch)
treed2f3f80fe7e211c93e1d95c63eef58a862a1c7b4
parentc5d1a4ffd96528b49a9e34e06706f1499cd0fe80 (diff)
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
-rw-r--r--lib/CodeGen/MachineLICM.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/CodeGen/MachineLICM.cpp b/lib/CodeGen/MachineLICM.cpp
index 76d5f37794..dd32977f90 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;