[PATCH] D133302: [RISCV] Add assertion of hasVecPolicyOp to catch masked intrinsic without policy operand.

Yeting Kuo via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 12 19:10:01 PDT 2022


This revision was automatically updated to reflect the committed changes.
Closed by commit rG5fcb5d77599e: [RISCV] Add assertion of hasVecPolicyOp to catch masked intrinsic without… (authored by fakepaper56).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D133302

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


Index: llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp
===================================================================
--- llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp
+++ llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp
@@ -2697,14 +2697,15 @@
 
     SDLoc DL(N);
     unsigned MaskedOpc = Info->MaskedPseudo;
+    assert(RISCVII::hasVecPolicyOp(TII->get(MaskedOpc).TSFlags) &&
+           "Expected instructions with mask have policy operand.");
+
     SmallVector<SDValue, 8> Ops;
     Ops.push_back(Merge);
     Ops.append(True->op_begin(), True->op_begin() + TrueVLIndex);
     Ops.append({Mask, VL, /* SEW */ True.getOperand(TrueVLIndex + 1)});
-
-    if (RISCVII::hasVecPolicyOp(TII->get(MaskedOpc).TSFlags))
-      Ops.push_back(
-          CurDAG->getTargetConstant(/* TUMU */ 0, DL, Subtarget->getXLenVT()));
+    Ops.push_back(
+        CurDAG->getTargetConstant(/* TUMU */ 0, DL, Subtarget->getXLenVT()));
 
     // Result node should have chain operand of True.
     if (HasChainOp)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D133302.459624.patch
Type: text/x-patch
Size: 990 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220913/b232c8a2/attachment.bin>


More information about the llvm-commits mailing list