]> granicus.if.org Git - llvm/commitdiff
Fix MSVC "result of 32-bit shift implicitly converted to 64 bits" warning. NFCI.
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Tue, 17 Jul 2018 09:39:55 +0000 (09:39 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Tue, 17 Jul 2018 09:39:55 +0000 (09:39 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@337257 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/InstCombine/InstCombineCompares.cpp

index d50dfa75552246c41775cc9232bfd9d62d2e1fd2..d67a9793e4f900a651014aebcb1b8702c014bd95 100644 (file)
@@ -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)))