[X86][mem-fold] Remove redundant variable IsAligned, NFCI
authorShengchen Kan <shengchen.kan@intel.com>
Thu, 6 Apr 2023 09:18:03 +0000 (17:18 +0800)
committerShengchen Kan <shengchen.kan@intel.com>
Thu, 6 Apr 2023 09:18:03 +0000 (17:18 +0800)
llvm/utils/TableGen/X86FoldTablesEmitter.cpp

index 9b1d5fe..0926732 100644 (file)
@@ -76,7 +76,6 @@ class X86FoldTablesEmitter {
     bool CannotFold = false;
     bool IsLoad = false;
     bool IsStore = false;
-    bool IsAligned = false;
     Align Alignment;
 
     X86FoldTableEntry() = default;
@@ -98,7 +97,7 @@ class X86FoldTablesEmitter {
         Attrs += "TB_NO_REVERSE|";
       if (CannotFold)
         Attrs += "TB_NO_FORWARD|";
-      if (IsAligned)
+      if (Alignment != Align(1))
         Attrs += "TB_ALIGN_" + std::to_string(Alignment.value()) + "|";
 
       StringRef SimplifiedAttrs = StringRef(Attrs).rtrim("|");
@@ -388,7 +387,6 @@ void X86FoldTablesEmitter::addEntryWithFlags(FoldTable &Table,
     Result.CannotFold = (S & TB_NO_FORWARD) != 0;
     Result.IsLoad = (S & TB_FOLDED_LOAD) != 0;
     Result.IsStore = (S & TB_FOLDED_STORE) != 0;
-    Result.IsAligned = (S & TB_ALIGN_MASK) != 0;
     Result.Alignment = Align(1ULL << ((S & TB_ALIGN_MASK) >> TB_ALIGN_SHIFT));
     Table[RegInstr] = Result;
     return;
@@ -441,13 +439,11 @@ void X86FoldTablesEmitter::addEntryWithFlags(FoldTable &Table,
   if (isExplicitAlign(RegInstr)) {
     // The instruction require explicitly aligned memory.
     BitsInit *VectSize = RegRec->getValueAsBitsInit("VectSize");
-    Result.IsAligned = true;
     Result.Alignment = Align(byteFromBitsInit(VectSize));
   } else if (!Enc && !isExplicitUnalign(RegInstr) &&
              getMemOperandSize(MemOpRec) > 64) {
     // Instructions with XOP/VEX/EVEX encoding do not require alignment while
     // SSE packed vector instructions require a 16 byte alignment.
-    Result.IsAligned = true;
     Result.Alignment = Align(16);
   }
   // Expand is only ever created as a masked instruction. It is not safe to