[RISCV][InsertVSETVLI] vmv.s.x and fvmv.s.f do not depend on LMUL
authorPhilip Reames <preames@rivosinc.com>
Thu, 8 Dec 2022 18:12:00 +0000 (10:12 -0800)
committerPhilip Reames <listmail@philipreames.com>
Thu, 8 Dec 2022 18:14:39 +0000 (10:14 -0800)
We already have this rule encoded elsewhere in the file - which is why we don't see any test changes.  I'm adding it here for completionism.

This is not technically NFC since there could be a test case which isn't caught by the specific rules, but is handled by the generic logic.  I don't have such an example.

llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp

index aae570c..faa2d8f 100644 (file)
@@ -232,6 +232,11 @@ static DemandedFields getDemanded(const MachineInstr &MI) {
     Res.LMUL = false;
   }
 
+  // For vmv.s.x and vfmv.s.f, there is only two behaviors, VL = 0 and VL > 0.
+  // As such, the result does not depend on LMUL.
+  if (isScalarMoveInstr(MI))
+    Res.LMUL = false;
+
   return Res;
 }