[llvm-branch-commits] [RISCV][MC] Warn if SEW/LMUL may not be compatible (PR #94313)

Craig Topper via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Wed Jun 5 10:20:17 PDT 2024


================
@@ -2155,6 +2155,17 @@ bool RISCVAsmParser::parseVTypeToken(const AsmToken &Tok, VTypeState &State,
       break;
     if (!RISCVVType::isValidLMUL(Lmul, Fractional))
       break;
+
+    if (Fractional) {
+      unsigned ELEN = STI->hasFeature(RISCV::FeatureStdExtZve64x) ? 64 : 32;
+      unsigned MinLMUL = ELEN / 8;
+      if (Lmul > MinLMUL)
+        Warning(
+            Tok.getLoc(),
+            Twine("The use of vtype encodings with LMUL < SEWMIN/ELEN == mf") +
----------------
topperc wrote:

I don't think you need `Twine` around the strings. Probably just on the `MinLMUL`

https://github.com/llvm/llvm-project/pull/94313


More information about the llvm-branch-commits mailing list