[llvm] r337257 - 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 Jul 17 02:39:55 PDT 2018
Author: rksimon
Date: Tue Jul 17 02:39:55 2018
New Revision: 337257
URL: http://llvm.org/viewvc/llvm-project?rev=337257&view=rev
Log:
Fix MSVC "result of 32-bit shift implicitly converted to 64 bits" warning. NFCI.
Modified:
llvm/trunk/lib/Transforms/InstCombine/InstCombineCompares.cpp
Modified: llvm/trunk/lib/Transforms/InstCombine/InstCombineCompares.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/InstCombine/InstCombineCompares.cpp?rev=337257&r1=337256&r2=337257&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/InstCombine/InstCombineCompares.cpp (original)
+++ llvm/trunk/lib/Transforms/InstCombine/InstCombineCompares.cpp Tue Jul 17 02:39:55 2018
@@ -2999,8 +2999,8 @@ foldICmpWithTruncSignExtendedVal(ICmpIns
const uint64_t XBitWidth = C0->getBitWidth();
const uint64_t KeptBits = XBitWidth - MaskedBits;
- const uint64_t ICmpCst = 1UL << KeptBits; // (1 << KeptBits)
- const uint64_t AddCst = ICmpCst >> 1UL; // (1 << (KeptBits-1))
+ const uint64_t ICmpCst = (uint64_t)1 << KeptBits; // (1 << KeptBits)
+ const uint64_t AddCst = ICmpCst >> 1; // (1 << (KeptBits-1))
auto *XType = X->getType();
// (add %x, (1 << (KeptBits-1)))
More information about the llvm-commits
mailing list