From: Simon Pilgrim Date: Tue, 17 Jul 2018 09:39:55 +0000 (+0000) Subject: Fix MSVC "result of 32-bit shift implicitly converted to 64 bits" warning. NFCI. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=15fa57ae79a42c5fb1d59c25841657049a0404ec;p=llvm Fix MSVC "result of 32-bit shift implicitly converted to 64 bits" warning. NFCI. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@337257 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Transforms/InstCombine/InstCombineCompares.cpp b/lib/Transforms/InstCombine/InstCombineCompares.cpp index d50dfa75552..d67a9793e4f 100644 --- a/lib/Transforms/InstCombine/InstCombineCompares.cpp +++ b/lib/Transforms/InstCombine/InstCombineCompares.cpp @@ -2999,8 +2999,8 @@ foldICmpWithTruncSignExtendedVal(ICmpInst &I, 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)))