[llvm] b385c01 - [RISCV][InsertVSETVLI] Reorder code to reduce a future diff [nfc]

Philip Reames via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 12 14:46:24 PST 2022


Author: Philip Reames
Date: 2022-12-12T14:46:00-08:00
New Revision: b385c01f24e00a30d6414ae27ffb178a73ce68f9

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

LOG: [RISCV][InsertVSETVLI] Reorder code to reduce a future diff [nfc]

Added: 
    

Modified: 
    llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp b/llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp
index faa2d8f22d227..3be1ae640330b 100644
--- a/llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp
+++ b/llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp
@@ -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,


        


More information about the llvm-commits mailing list