aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/LoopAligner.cpp
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2008-10-01 23:18:38 +0000
committerDevang Patel <dpatel@apple.com>2008-10-01 23:18:38 +0000
commit4ae641f4d12c60ee1aaca5e42b6de231c6a02c40 (patch)
tree76f97c15558ecdeb6cb91a6282320c169d52dae9 /lib/CodeGen/LoopAligner.cpp
parentdc756858f92a397ed30362ba8251fec56479735f (diff)
Remove OptimizeForSize global. Use function attribute optsize.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56937 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/LoopAligner.cpp')
-rw-r--r--lib/CodeGen/LoopAligner.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/CodeGen/LoopAligner.cpp b/lib/CodeGen/LoopAligner.cpp
index 6cca8e5bad..60e3f19430 100644
--- a/lib/CodeGen/LoopAligner.cpp
+++ b/lib/CodeGen/LoopAligner.cpp
@@ -58,6 +58,10 @@ bool LoopAligner::runOnMachineFunction(MachineFunction &MF) {
if (!Align)
return false; // Don't care about loop alignment.
+ const Function *F = MF.getFunction();
+ if (!F->isDeclaration() && F->hasFnAttr(Attribute::OptimizeForSize))
+ return false;
+
for (MachineFunction::iterator I = MF.begin(), E = MF.end(); I != E; ++I) {
MachineBasicBlock *MBB = I;
if (MLI->isLoopHeader(MBB))