diff options
author | Guillaume Chatelet <gchatelet@google.com> | 2019-09-10 12:00:43 +0000 |
---|---|---|
committer | Guillaume Chatelet <gchatelet@google.com> | 2019-09-10 12:00:43 +0000 |
commit | 3729b17cff53b536d2019b2d4c90e2a6f17754d1 (patch) | |
tree | c81c4a70fe4cf2efe3f437e0282a9918d0b6f483 /llvm/lib/CodeGen/MachineBlockPlacement.cpp | |
parent | bc48588f764a21b81a4cf16f878fbe98d4151819 (diff) | |
download | llvm-3729b17cff53b536d2019b2d4c90e2a6f17754d1.zip llvm-3729b17cff53b536d2019b2d4c90e2a6f17754d1.tar.gz llvm-3729b17cff53b536d2019b2d4c90e2a6f17754d1.tar.bz2 |
[Alignment][NFC] Use llvm::Align for TargetLowering::getPrefLoopAlignment
Summary:
This is patch is part of a series to introduce an Alignment type.
See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
See this patch for the introduction of the type: https://reviews.llvm.org/D64790
Reviewers: courbet
Reviewed By: courbet
Subscribers: wuzish, arsenm, nemanjai, jvesely, nhaehnle, hiraditya, kbarton, MaskRay, jsji, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D67386
llvm-svn: 371511
Diffstat (limited to 'llvm/lib/CodeGen/MachineBlockPlacement.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineBlockPlacement.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/MachineBlockPlacement.cpp b/llvm/lib/CodeGen/MachineBlockPlacement.cpp index c9441bd8..babc051 100644 --- a/llvm/lib/CodeGen/MachineBlockPlacement.cpp +++ b/llvm/lib/CodeGen/MachineBlockPlacement.cpp @@ -2807,8 +2807,8 @@ void MachineBlockPlacement::alignBlocks() { if (!L) continue; - unsigned LogAlign = TLI->getPrefLoopLogAlignment(L); - if (!LogAlign) + const llvm::Align Align = TLI->getPrefLoopAlignment(L); + if (Align == 1) continue; // Don't care about loop alignment. // If the block is cold relative to the function entry don't waste space @@ -2832,7 +2832,7 @@ void MachineBlockPlacement::alignBlocks() { // Force alignment if all the predecessors are jumps. We already checked // that the block isn't cold above. if (!LayoutPred->isSuccessor(ChainBB)) { - ChainBB->setLogAlignment(LogAlign); + ChainBB->setLogAlignment(Log2(Align)); continue; } @@ -2844,7 +2844,7 @@ void MachineBlockPlacement::alignBlocks() { MBPI->getEdgeProbability(LayoutPred, ChainBB); BlockFrequency LayoutEdgeFreq = MBFI->getBlockFreq(LayoutPred) * LayoutProb; if (LayoutEdgeFreq <= (Freq * ColdProb)) - ChainBB->setLogAlignment(LogAlign); + ChainBB->setLogAlignment(Log2(Align)); } } |