summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/LoopAligner.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/CodeGen/LoopAligner.cpp')
-rw-r--r--llvm/lib/CodeGen/LoopAligner.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/LoopAligner.cpp b/llvm/lib/CodeGen/LoopAligner.cpp
index 6cca8e5badc..60e3f194305 100644
--- a/llvm/lib/CodeGen/LoopAligner.cpp
+++ b/llvm/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))
OpenPOWER on IntegriCloud