[MBP] Use Function::optForSize() instead of checking OptimizeForSize directly.
Fix a FIXME. Disable loop alignment if compiled with -Oz now.
llvm-svn: 268121
diff --git a/llvm/lib/CodeGen/MachineBlockPlacement.cpp b/llvm/lib/CodeGen/MachineBlockPlacement.cpp
index 970be7f..baa9df6 100644
--- a/llvm/lib/CodeGen/MachineBlockPlacement.cpp
+++ b/llvm/lib/CodeGen/MachineBlockPlacement.cpp
@@ -1366,8 +1366,7 @@
// exclusively on the loop info here so that we can align backedges in
// unnatural CFGs and backedges that were introduced purely because of the
// loop rotations done during this layout pass.
- // FIXME: Use Function::optForSize().
- if (F.getFunction()->hasFnAttribute(Attribute::OptimizeForSize))
+ if (F.getFunction()->optForSize())
return;
BlockChain &FunctionChain = *BlockToChain[&F.front()];
if (FunctionChain.begin() == FunctionChain.end())