[PATCH] D155313: [RISCV] Fix predicates on zvbb patterns
Luke Lau via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Jul 14 10:05:06 PDT 2023
luke created this revision.
luke added reviewers: craig.topper, reames, fakepaper56, 4vtomat.
Herald added subscribers: jobnoorman, asb, pmatos, VincentWu, vkmr, frasercrmck, luismarques, 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.
luke requested review of this revision.
Herald added subscribers: llvm-commits, wangpc, eopXD, MaskRay.
Herald added a project: LLVM.
The zvbb extension predicate was getting overwritten by the vtype predicates.
There's no change in the tests though because the ISD nodes were getting
expanded before instruction selection.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D155313
Files:
llvm/lib/Target/RISCV/RISCVInstrInfoZvk.td
Index: llvm/lib/Target/RISCV/RISCVInstrInfoZvk.td
===================================================================
--- llvm/lib/Target/RISCV/RISCVInstrInfoZvk.td
+++ llvm/lib/Target/RISCV/RISCVInstrInfoZvk.td
@@ -204,7 +204,8 @@
multiclass VPatUnarySDNode_V<SDPatternOperator op, string instruction_name> {
foreach vti = AllIntegerVectors in {
- let Predicates = GetVTypePredicates<vti>.Predicates in {
+ let Predicates = !listconcat([HasStdExtZvbb],
+ GetVTypePredicates<vti>.Predicates) in {
def : Pat<(vti.Vector (op (vti.Vector vti.RegClass:$rs1))),
(!cast<Instruction>(instruction_name#"_V_"#vti.LMul.MX)
(vti.Vector (IMPLICIT_DEF)),
@@ -214,10 +215,8 @@
}
}
-let Predicates = [HasStdExtZvbb] in {
- defm : VPatUnarySDNode_V<bitreverse, "PseudoVBREV">;
- defm : VPatUnarySDNode_V<bswap, "PseudoVREV8">;
- defm : VPatUnarySDNode_V<ctlz, "PseudoVCLZ">;
- defm : VPatUnarySDNode_V<cttz, "PseudoVCTZ">;
- defm : VPatUnarySDNode_V<ctpop, "PseudoVCPOP">;
-}
+defm : VPatUnarySDNode_V<bitreverse, "PseudoVBREV">;
+defm : VPatUnarySDNode_V<bswap, "PseudoVREV8">;
+defm : VPatUnarySDNode_V<ctlz, "PseudoVCLZ">;
+defm : VPatUnarySDNode_V<cttz, "PseudoVCTZ">;
+defm : VPatUnarySDNode_V<ctpop, "PseudoVCPOP">;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D155313.540472.patch
Type: text/x-patch
Size: 1305 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230714/7a858389/attachment.bin>
More information about the llvm-commits
mailing list