[llvm] d9af50e - [Transforms] getOrEnforceKnownAlignment - fix MSVC result of 32-bit shift implicitly converted to 64 bits warning. NFCI
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Tue Apr 21 10:32:30 PDT 2020
Author: Simon Pilgrim
Date: 2020-04-21T18:32:12+01:00
New Revision: d9af50efbc5f74fac94384571f9315a452dcfad0
URL: https://github.com/llvm/llvm-project/commit/d9af50efbc5f74fac94384571f9315a452dcfad0
DIFF: https://github.com/llvm/llvm-project/commit/d9af50efbc5f74fac94384571f9315a452dcfad0.diff
LOG: [Transforms] getOrEnforceKnownAlignment - fix MSVC result of 32-bit shift implicitly converted to 64 bits warning. NFCI
We don't overflow here so we can use a U64 shift directly.
Added:
Modified:
llvm/lib/Transforms/Utils/Local.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Transforms/Utils/Local.cpp b/llvm/lib/Transforms/Utils/Local.cpp
index 3e4f484f8ac4..b87cb0009113 100644
--- a/llvm/lib/Transforms/Utils/Local.cpp
+++ b/llvm/lib/Transforms/Utils/Local.cpp
@@ -1217,7 +1217,7 @@ Align llvm::getOrEnforceKnownAlignment(Value *V, MaybeAlign PrefAlign,
// LLVM doesn't support alignments larger than (1 << MaxAlignmentExponent).
TrailZ = std::min(TrailZ, +Value::MaxAlignmentExponent);
- Align Alignment = Align(1u << std::min(Known.getBitWidth() - 1, TrailZ));
+ Align Alignment = Align(1ull << std::min(Known.getBitWidth() - 1, TrailZ));
if (PrefAlign && *PrefAlign > Alignment)
Alignment = enforceKnownAlignment(V, Alignment, *PrefAlign, DL);
More information about the llvm-commits
mailing list