[llvm] 364b193 - [RISCV] Add assertions to VSETVLIInfo::hasSEWLMULRatioOnly(). NFC (#189799)

via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 1 09:01:31 PDT 2026


Author: Craig Topper
Date: 2026-04-01T09:01:26-07:00
New Revision: 364b19322db209f6a465934e7483a6e1dde14043

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

LOG: [RISCV] Add assertions to VSETVLIInfo::hasSEWLMULRatioOnly(). NFC (#189799)

Ensure that we can only call this on valid and not unknown.

Added: 
    

Modified: 
    llvm/lib/Target/RISCV/RISCVVSETVLIInfoAnalysis.h

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/RISCV/RISCVVSETVLIInfoAnalysis.h b/llvm/lib/Target/RISCV/RISCVVSETVLIInfoAnalysis.h
index ec8b8c3fc9812..01aa1622d668a 100644
--- a/llvm/lib/Target/RISCV/RISCVVSETVLIInfoAnalysis.h
+++ b/llvm/lib/Target/RISCV/RISCVVSETVLIInfoAnalysis.h
@@ -268,7 +268,11 @@ class VSETVLIInfo {
     }
   }
 
-  bool hasSEWLMULRatioOnly() const { return SEWLMULRatioOnly; }
+  bool hasSEWLMULRatioOnly() const {
+    assert(isValid() && !isUnknown() &&
+           "Can't use VTYPE for uninitialized or unknown");
+    return SEWLMULRatioOnly;
+  }
 
   unsigned getSEW() const {
     assert(isValid() && !isUnknown() && !hasSEWLMULRatioOnly() &&


        


More information about the llvm-commits mailing list