[PATCH] D155683: [RISCV] Fix the check assertion in hasMergeOp and hasMaskOp

Jianjian Guan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 19 01:37:01 PDT 2023


jacquesguan created this revision.
jacquesguan added reviewers: craig.topper, asb, luismarques, frasercrmck.
Herald added subscribers: jobnoorman, luke, VincentWu, vkmr, apazos, sameer.abuasal, s.egerton, Jim, benna, psnobl, jocewei, PkmX, the_o, brucehoult, MartinMosbeck, rogfer01, edward-jones, zzheng, jrtc27, shiva0217, kito-cheng, niosHD, sabuasal, simoncook, johnrusso, rbar, hiraditya, arichardson.
Herald added a project: All.
jacquesguan requested review of this revision.
Herald added subscribers: llvm-commits, wangpc, eopXD, MaskRay.
Herald added a project: LLVM.

Because we have STRICT_FCVT_W_RV64 equal to ISD::FIRST_TARGET_STRICTFP_OPCODE, the check needs to be splitted into 2 parts.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D155683

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


Index: llvm/lib/Target/RISCV/RISCVISelLowering.cpp
===================================================================
--- llvm/lib/Target/RISCV/RISCVISelLowering.cpp
+++ llvm/lib/Target/RISCV/RISCVISelLowering.cpp
@@ -4683,7 +4683,10 @@
   assert(Opcode > RISCVISD::FIRST_NUMBER &&
          Opcode <= RISCVISD::STRICT_VFROUND_NOEXCEPT_VL &&
          "not a RISC-V target specific op");
-  assert(RISCVISD::STRICT_VFROUND_NOEXCEPT_VL - RISCVISD::FIRST_NUMBER == 421 &&
+  assert(RISCVISD::VFIRST_VL - RISCVISD::FIRST_NUMBER == 177 &&
+         RISCVISD::STRICT_VFROUND_NOEXCEPT_VL -
+                 ISD::FIRST_TARGET_STRICTFP_OPCODE ==
+             21 &&
          "adding target specific op should update this function");
   if (Opcode >= RISCVISD::ADD_VL && Opcode <= RISCVISD::FMAXNUM_VL)
     return true;
@@ -4701,7 +4704,10 @@
   assert(Opcode > RISCVISD::FIRST_NUMBER &&
          Opcode <= RISCVISD::STRICT_VFROUND_NOEXCEPT_VL &&
          "not a RISC-V target specific op");
-  assert(RISCVISD::STRICT_VFROUND_NOEXCEPT_VL - RISCVISD::FIRST_NUMBER == 421 &&
+  assert(RISCVISD::VFIRST_VL - RISCVISD::FIRST_NUMBER == 177 &&
+         RISCVISD::STRICT_VFROUND_NOEXCEPT_VL -
+                 ISD::FIRST_TARGET_STRICTFP_OPCODE ==
+             21 &&
          "adding target specific op should update this function");
   if (Opcode >= RISCVISD::TRUNCATE_VECTOR_VL && Opcode <= RISCVISD::SETCC_VL)
     return true;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D155683.541890.patch
Type: text/x-patch
Size: 1425 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230719/4d81b430/attachment.bin>


More information about the llvm-commits mailing list