[PATCH] D133810: [RISCV] Verify consistency of a couple TSFlags related to vector operands

Philip Reames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 21 13:30:52 PDT 2022


reames updated this revision to Diff 461996.
reames added a comment.

Rebase


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D133810/new/

https://reviews.llvm.org/D133810

Files:
  llvm/lib/Target/RISCV/RISCVInstrInfo.cpp


Index: llvm/lib/Target/RISCV/RISCVInstrInfo.cpp
===================================================================
--- llvm/lib/Target/RISCV/RISCVInstrInfo.cpp
+++ llvm/lib/Target/RISCV/RISCVInstrInfo.cpp
@@ -1237,6 +1237,10 @@
         return false;
       }
     }
+    if (!RISCVII::hasSEWOp(TSFlags)) {
+      ErrInfo = "VL operand w/o SEW operand?";
+      return false;
+    }
   }
   if (RISCVII::hasSEWOp(TSFlags)) {
     unsigned OpIdx = RISCVII::getSEWOpNum(Desc);
@@ -1258,6 +1262,10 @@
       ErrInfo = "Invalid Policy Value";
       return false;
     }
+    if (!RISCVII::hasVLOp(TSFlags)) {
+      ErrInfo = "policy operand w/o VL operand?";
+      return false;
+    }
   }
 
   return true;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D133810.461996.patch
Type: text/x-patch
Size: 709 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220921/409cc1ed/attachment.bin>


More information about the llvm-commits mailing list