[RISCV][InsertVSETVLI] Reorder code to reduce a future diff [nfc]
authorPhilip Reames <preames@rivosinc.com>
Mon, 12 Dec 2022 21:48:05 +0000 (13:48 -0800)
committerPhilip Reames <listmail@philipreames.com>
Mon, 12 Dec 2022 22:46:00 +0000 (14:46 -0800)
llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp

index faa2d8f..3be1ae6 100644 (file)
@@ -771,12 +771,12 @@ bool RISCVInsertVSETVLI::needVSETVLI(const MachineInstr &MI,
                                      const VSETVLIInfo &CurInfo) const {
   assert(Require == computeInfoForInstr(MI, MI.getDesc().TSFlags, MRI));
 
-  if (CurInfo.isCompatible(MI, Require))
-    return false;
-
   if (!CurInfo.isValid() || CurInfo.isUnknown() || CurInfo.hasSEWLMULRatioOnly())
     return true;
 
+  if (CurInfo.isCompatible(MI, Require))
+    return false;
+
   // For vmv.s.x and vfmv.s.f, there is only two behaviors, VL = 0 and VL > 0.
   // Additionally, if writing to an implicit_def operand, we don't need to
   // preserve any other bits and are thus compatible with any larger etype,