[llvm] 933dd03 - [RISCV] Remove checks that MI's info is valid. NFC

Luke Lau via llvm-commits llvm-commits at lists.llvm.org
Sun Nov 19 21:24:38 PST 2023


Author: Luke Lau
Date: 2023-11-20T13:17:15+08:00
New Revision: 933dd03386df3c0cfedf4fe6bc984d776f1298ca

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

LOG: [RISCV] Remove checks that MI's info is valid. NFC

It's always guaranteed to be valid since we compute it ourselves from MI.
This should simplify an upcoming change in #72352

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 a7b0bb372bbfe6d..3bbc85d836c3f4a 100644
--- a/llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp
+++ b/llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp
@@ -1023,6 +1023,7 @@ void RISCVInsertVSETVLI::transferBefore(VSETVLIInfo &Info,
     return;
 
   const VSETVLIInfo NewInfo = computeInfoForInstr(MI, TSFlags, MRI);
+  assert(NewInfo.isValid() && !NewInfo.isUnknown());
   if (Info.isValid() && !needVSETVLI(MI, NewInfo, Info))
     return;
 
@@ -1036,8 +1037,8 @@ void RISCVInsertVSETVLI::transferBefore(VSETVLIInfo &Info,
   // maintain the SEW/LMUL ratio. This allows us to eliminate VL toggles in more
   // places.
   DemandedFields Demanded = getDemanded(MI, MRI, ST);
-  if (!Demanded.LMUL && !Demanded.SEWLMULRatio && Info.isValid() &&
-      PrevInfo.isValid() && !Info.isUnknown() && !PrevInfo.isUnknown()) {
+  if (!Demanded.LMUL && !Demanded.SEWLMULRatio && PrevInfo.isValid() &&
+      !PrevInfo.isUnknown()) {
     if (auto NewVLMul = RISCVVType::getSameRatioLMUL(
             PrevInfo.getSEW(), PrevInfo.getVLMUL(), Info.getSEW()))
       Info.setVLMul(*NewVLMul);


        


More information about the llvm-commits mailing list