aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/InlineFunction.cpp
diff options
context:
space:
mode:
authorGuillaume Chatelet <gchatelet@google.com>2022-06-18 14:34:11 +0000
committerGuillaume Chatelet <gchatelet@google.com>2022-06-20 08:37:48 +0000
commitf1255186c7c4a631c051e05ed12ea79ed091141d (patch)
tree7fe7660560cbfd5bc5ddb8642f0307849354c213 /llvm/lib/Transforms/Utils/InlineFunction.cpp
parent009fe0755e47ef824aa4066d51db75aa9021399b (diff)
downloadllvm-f1255186c7c4a631c051e05ed12ea79ed091141d.zip
llvm-f1255186c7c4a631c051e05ed12ea79ed091141d.tar.gz
llvm-f1255186c7c4a631c051e05ed12ea79ed091141d.tar.bz2
[NFC][Alignment] Remove max functions between Align and MaybeAlign
`llvm::max(Align, MaybeAlign)` and `llvm::max(MaybeAlign, Align)` are not used often enough to be required. They also make the code more opaque. Differential Revision: https://reviews.llvm.org/D128121
Diffstat (limited to 'llvm/lib/Transforms/Utils/InlineFunction.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/InlineFunction.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Utils/InlineFunction.cpp b/llvm/lib/Transforms/Utils/InlineFunction.cpp
index 8f88ca24..03cb9e2 100644
--- a/llvm/lib/Transforms/Utils/InlineFunction.cpp
+++ b/llvm/lib/Transforms/Utils/InlineFunction.cpp
@@ -1421,7 +1421,8 @@ static Value *HandleByValArgument(Type *ByValType, Value *Arg,
// If the byval had an alignment specified, we *must* use at least that
// alignment, as it is required by the byval argument (and uses of the
// pointer inside the callee).
- Alignment = max(Alignment, MaybeAlign(ByValAlignment));
+ if (ByValAlignment > 0)
+ Alignment = std::max(Alignment, Align(ByValAlignment));
Value *NewAlloca =
new AllocaInst(ByValType, DL.getAllocaAddrSpace(), nullptr, Alignment,