diff options
author | Guillaume Chatelet <gchatelet@google.com> | 2020-07-01 14:31:56 +0000 |
---|---|---|
committer | Guillaume Chatelet <gchatelet@google.com> | 2020-07-01 14:31:56 +0000 |
commit | d3085c25012aceef3755abf9921a0368c64f40c6 (patch) | |
tree | 5f0a3cdb0a6bfbe94479565f5b715baf3c0be1b3 /llvm/lib/Analysis/ValueTracking.cpp | |
parent | 27bbc8ede127fb1ea8b6a853a5d2fe70f206408b (diff) | |
download | llvm-d3085c25012aceef3755abf9921a0368c64f40c6.zip llvm-d3085c25012aceef3755abf9921a0368c64f40c6.tar.gz llvm-d3085c25012aceef3755abf9921a0368c64f40c6.tar.bz2 |
[Alignment][NFC] Transition and simplify calls to DL::getABITypeAlignment
This 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
Differential Revision: https://reviews.llvm.org/D82956
Diffstat (limited to 'llvm/lib/Analysis/ValueTracking.cpp')
-rw-r--r-- | llvm/lib/Analysis/ValueTracking.cpp | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/llvm/lib/Analysis/ValueTracking.cpp b/llvm/lib/Analysis/ValueTracking.cpp index 3979d3d..614c8bb 100644 --- a/llvm/lib/Analysis/ValueTracking.cpp +++ b/llvm/lib/Analysis/ValueTracking.cpp @@ -1444,17 +1444,9 @@ static void computeKnownBitsFromOperator(const Operator *I, Known.Zero.setHighBits(Leaders); break; } - - case Instruction::Alloca: { - const AllocaInst *AI = cast<AllocaInst>(I); - unsigned Align = AI->getAlignment(); - if (Align == 0) - Align = Q.DL.getABITypeAlignment(AI->getAllocatedType()); - - if (Align > 0) - Known.Zero.setLowBits(countTrailingZeros(Align)); + case Instruction::Alloca: + Known.Zero.setLowBits(Log2(cast<AllocaInst>(I)->getAlign())); break; - } case Instruction::GetElementPtr: { // Analyze all of the subscripts of this getelementptr instruction // to determine if we can prove known low zero bits. |