aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MachineBlockPlacement.cpp
diff options
context:
space:
mode:
authorHaicheng Wu <haicheng@codeaurora.org>2016-04-29 22:01:10 +0000
committerHaicheng Wu <haicheng@codeaurora.org>2016-04-29 22:01:10 +0000
commit4afe0425db445efbb92fc3ba36d828dde5d3a8d6 (patch)
treedec931d9ddce98f764978f9ac2d508c89759e844 /llvm/lib/CodeGen/MachineBlockPlacement.cpp
parentee81b23fe78d70aef8a49df2c55a6d98f611a77d (diff)
downloadllvm-4afe0425db445efbb92fc3ba36d828dde5d3a8d6.zip
llvm-4afe0425db445efbb92fc3ba36d828dde5d3a8d6.tar.gz
llvm-4afe0425db445efbb92fc3ba36d828dde5d3a8d6.tar.bz2
[MBP] Use Function::optForSize() instead of checking OptimizeForSize directly.
Fix a FIXME. Disable loop alignment if compiled with -Oz now. llvm-svn: 268121
Diffstat (limited to 'llvm/lib/CodeGen/MachineBlockPlacement.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineBlockPlacement.cpp3
1 files changed, 1 insertions, 2 deletions
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 @@ void MachineBlockPlacement::alignBlocks(MachineFunction &F) {
// 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())