Skip to content

Commit baa6609

Browse files
committed
Recommit "[RISCV] Use vadd.vi for tail undisturbe vsub intrinsic with small immediate."
Now with the correct tail policy. Original message: Our pattern previously checked for the merge operand being undef.
1 parent 16aef9e commit baa6609

File tree

2 files changed

+359
-6
lines changed

2 files changed

+359
-6
lines changed

llvm/lib/Target/RISCV/RISCVInstrInfoVPseudos.td

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6297,15 +6297,16 @@ foreach vti = AllIntegerVectors in {
62976297
(XLenVT timm:$policy))>;
62986298

62996299
// Match VSUB with a small immediate to vadd.vi by negating the immediate.
6300-
def : Pat<(vti.Vector (int_riscv_vsub (vti.Vector (undef)),
6300+
def : Pat<(vti.Vector (int_riscv_vsub (vti.Vector vti.RegClass:$merge),
63016301
(vti.Vector vti.RegClass:$rs1),
63026302
(vti.Scalar simm5_plus1:$rs2),
63036303
VLOpFrag)),
6304-
(!cast<Instruction>("PseudoVADD_VI_"#vti.LMul.MX) (vti.Vector (IMPLICIT_DEF)),
6305-
vti.RegClass:$rs1,
6306-
(NegImm simm5_plus1:$rs2),
6307-
GPR:$vl,
6308-
vti.Log2SEW, TA_MA)>;
6304+
(!cast<Instruction>("PseudoVADD_VI_"#vti.LMul.MX)
6305+
vti.RegClass:$merge,
6306+
vti.RegClass:$rs1,
6307+
(NegImm simm5_plus1:$rs2),
6308+
GPR:$vl,
6309+
vti.Log2SEW, TU_MU)>;
63096310
def : Pat<(vti.Vector (int_riscv_vsub_mask (vti.Vector vti.RegClass:$merge),
63106311
(vti.Vector vti.RegClass:$rs1),
63116312
(vti.Scalar simm5_plus1:$rs2),

0 commit comments

Comments
 (0)