[llvm] 79cbeda - Fix MSVC "result of 32-bit shift implicitly converted to 64 bits" warning. NFC.

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Wed May 17 04:31:35 PDT 2023


Author: Simon Pilgrim
Date: 2023-05-17T12:31:18+01:00
New Revision: 79cbedaf057b4ee343c4d71561a8f424117975ae

URL: https://github.com/llvm/llvm-project/commit/79cbedaf057b4ee343c4d71561a8f424117975ae
DIFF: https://github.com/llvm/llvm-project/commit/79cbedaf057b4ee343c4d71561a8f424117975ae.diff

LOG: Fix MSVC "result of 32-bit shift implicitly converted to 64 bits" warning. NFC.

Added: 
    

Modified: 
    llvm/lib/Analysis/ScalarEvolution.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Analysis/ScalarEvolution.cpp b/llvm/lib/Analysis/ScalarEvolution.cpp
index 5f9b506ae398..504c94f09ba4 100644
--- a/llvm/lib/Analysis/ScalarEvolution.cpp
+++ b/llvm/lib/Analysis/ScalarEvolution.cpp
@@ -8339,8 +8339,8 @@ unsigned ScalarEvolution::getSmallConstantTripMultiple(const Loop *L,
   // If a trip multiple is huge (>=2^32), the trip count is still divisible by
   // the greatest power of 2 divisor less than 2^32.
   return Multiple.getActiveBits() > 32
-             ? 1U << std::min((uint32_t)31, Multiple.countTrailingZeros())
-             : Multiple.zextOrTrunc(32).getZExtValue();
+             ? 1U << std::min((unsigned)31, Multiple.countTrailingZeros())
+             : (unsigned)Multiple.zextOrTrunc(32).getZExtValue();
 }
 
 /// Returns the largest constant divisor of the trip count of this loop as a


        


More information about the llvm-commits mailing list