[llvm] 92af50f - [X86][NFC] Fix for warning C4334: '<<': result of 32-bit shift implicitly converted to 64 bits

Shengchen Kan via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 6 02:13:20 PDT 2023


Author: Shengchen Kan
Date: 2023-04-06T17:13:10+08:00
New Revision: 92af50f41c0c8b3787034aae26333295e3b476a0

URL: https://github.com/llvm/llvm-project/commit/92af50f41c0c8b3787034aae26333295e3b476a0
DIFF: https://github.com/llvm/llvm-project/commit/92af50f41c0c8b3787034aae26333295e3b476a0.diff

LOG: [X86][NFC] Fix for warning C4334: '<<': result of 32-bit shift implicitly converted to 64 bits

Added: 
    

Modified: 
    llvm/lib/Target/X86/X86InstrInfo.cpp
    llvm/utils/TableGen/X86FoldTablesEmitter.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/X86/X86InstrInfo.cpp b/llvm/lib/Target/X86/X86InstrInfo.cpp
index 8284906bdd2f..004104c860fd 100644
--- a/llvm/lib/Target/X86/X86InstrInfo.cpp
+++ b/llvm/lib/Target/X86/X86InstrInfo.cpp
@@ -6206,7 +6206,7 @@ MachineInstr *X86InstrInfo::foldMemoryOperandImpl(
         isTwoAddrFold || (OpNum == 0 && I->Flags & TB_FOLDED_LOAD) || OpNum > 0;
     bool FoldedStore =
         isTwoAddrFold || (OpNum == 0 && I->Flags & TB_FOLDED_STORE);
-    if (Alignment < Align(1 << ((I->Flags & TB_ALIGN_MASK) >> TB_ALIGN_SHIFT)))
+    if (Alignment < Align(1ULL << ((I->Flags & TB_ALIGN_MASK) >> TB_ALIGN_SHIFT)))
       return nullptr;
     bool NarrowToMOV32rm = false;
     if (Size) {

diff  --git a/llvm/utils/TableGen/X86FoldTablesEmitter.cpp b/llvm/utils/TableGen/X86FoldTablesEmitter.cpp
index 9fd35484b3f8..9b1d5fee6719 100644
--- a/llvm/utils/TableGen/X86FoldTablesEmitter.cpp
+++ b/llvm/utils/TableGen/X86FoldTablesEmitter.cpp
@@ -389,7 +389,7 @@ void X86FoldTablesEmitter::addEntryWithFlags(FoldTable &Table,
     Result.IsLoad = (S & TB_FOLDED_LOAD) != 0;
     Result.IsStore = (S & TB_FOLDED_STORE) != 0;
     Result.IsAligned = (S & TB_ALIGN_MASK) != 0;
-    Result.Alignment = Align(1 << ((S & TB_ALIGN_MASK) >> TB_ALIGN_SHIFT));
+    Result.Alignment = Align(1ULL << ((S & TB_ALIGN_MASK) >> TB_ALIGN_SHIFT));
     Table[RegInstr] = Result;
     return;
   }


        


More information about the llvm-commits mailing list