[RISCV] Use isShiftedInt to improve readability. NFC
authorCraig Topper <craig.topper@sifive.com>
Mon, 13 Jun 2022 03:34:14 +0000 (20:34 -0700)
committerCraig Topper <craig.topper@sifive.com>
Mon, 13 Jun 2022 04:04:45 +0000 (21:04 -0700)
llvm/lib/Target/RISCV/RISCVInstrInfoZb.td

index 33fe909..d31457d 100644 (file)
@@ -211,7 +211,7 @@ def CSImm12MulBy4 : PatLeaf<(imm), [{
     return false;
   int64_t C = N->getSExtValue();
   // Skip if C is simm12 or can be optimized by the PatLeaf AddiPair.
-  return !isInt<13>(C) && isInt<14>(C) && (C & 3) == 0;
+  return !isInt<13>(C) && isShiftedInt<12, 2>(C);
 }]>;
 
 def CSImm12MulBy8 : PatLeaf<(imm), [{
@@ -220,7 +220,7 @@ def CSImm12MulBy8 : PatLeaf<(imm), [{
   int64_t C = N->getSExtValue();
   // Skip if C is simm12 or can be optimized by the PatLeaf AddiPair or
   // CSImm12MulBy4.
-  return !isInt<14>(C) && isInt<15>(C) && (C & 7) == 0;
+  return !isInt<14>(C) && isShiftedInt<12, 3>(C);
 }]>;
 
 def SimmShiftRightBy2XForm : SDNodeXForm<imm, [{