@@ -1052,40 +1052,16 @@ multiclass VPatIntegerSetCCVL_VX_Swappable<VTypeInfo vti, string instruction_nam
10521052}
10531053
10541054multiclass VPatIntegerSetCCVL_VI_Swappable<VTypeInfo vti, string instruction_name,
1055- CondCode cc, CondCode invcc> {
1056- defvar instruction_masked = !cast<Instruction>(instruction_name#"_VI_"#vti.LMul.MX#"_MASK");
1057- def : Pat<(vti.Mask (riscv_setcc_vl (vti.Vector vti.RegClass:$rs1),
1058- (SplatPat_simm5 simm5:$rs2), cc,
1059- VR:$passthru,
1060- (vti.Mask V0),
1061- VLOpFrag)),
1062- (instruction_masked VR:$passthru, vti.RegClass:$rs1,
1063- XLenVT:$rs2, (vti.Mask V0), GPR:$vl,
1064- vti.Log2SEW)>;
1065-
1066- // FIXME: Can do some canonicalization to remove these patterns.
1067- def : Pat<(vti.Mask (riscv_setcc_vl (SplatPat_simm5 simm5:$rs2),
1068- (vti.Vector vti.RegClass:$rs1), invcc,
1069- VR:$passthru,
1070- (vti.Mask V0),
1071- VLOpFrag)),
1072- (instruction_masked VR:$passthru, vti.RegClass:$rs1,
1073- simm5:$rs2, (vti.Mask V0), GPR:$vl,
1074- vti.Log2SEW)>;
1075- }
1076-
1077- multiclass VPatIntegerSetCCVL_VIPlus1_Swappable<VTypeInfo vti,
1078- string instruction_name,
1079- CondCode cc, CondCode invcc,
1080- ComplexPattern splatpat_kind> {
1055+ CondCode cc, CondCode invcc,
1056+ ComplexPattern splatpat_kind = SplatPat_simm5> {
10811057 defvar instruction_masked = !cast<Instruction>(instruction_name#"_VI_"#vti.LMul.MX#"_MASK");
10821058 def : Pat<(vti.Mask (riscv_setcc_vl (vti.Vector vti.RegClass:$rs1),
10831059 (splatpat_kind simm5:$rs2), cc,
10841060 VR:$passthru,
10851061 (vti.Mask V0),
10861062 VLOpFrag)),
10871063 (instruction_masked VR:$passthru, vti.RegClass:$rs1,
1088- (DecImm simm5 :$rs2) , (vti.Mask V0), GPR:$vl,
1064+ XLenVT :$rs2, (vti.Mask V0), GPR:$vl,
10891065 vti.Log2SEW)>;
10901066
10911067 // FIXME: Can do some canonicalization to remove these patterns.
@@ -1095,7 +1071,7 @@ multiclass VPatIntegerSetCCVL_VIPlus1_Swappable<VTypeInfo vti,
10951071 (vti.Mask V0),
10961072 VLOpFrag)),
10971073 (instruction_masked VR:$passthru, vti.RegClass:$rs1,
1098- (DecImm simm5:$rs2) , (vti.Mask V0), GPR:$vl,
1074+ simm5:$rs2, (vti.Mask V0), GPR:$vl,
10991075 vti.Log2SEW)>;
11001076}
11011077
@@ -2173,14 +2149,14 @@ foreach vti = AllIntegerVectors in {
21732149 defm : VPatIntegerSetCCVL_VI_Swappable<vti, "PseudoVMSGT", SETGT, SETLT>;
21742150 defm : VPatIntegerSetCCVL_VI_Swappable<vti, "PseudoVMSGTU", SETUGT, SETULT>;
21752151
2176- defm : VPatIntegerSetCCVL_VIPlus1_Swappable <vti, "PseudoVMSLE", SETLT, SETGT,
2177- SplatPat_simm5_plus1>;
2178- defm : VPatIntegerSetCCVL_VIPlus1_Swappable <vti, "PseudoVMSLEU", SETULT, SETUGT,
2179- SplatPat_simm5_plus1_nonzero>;
2180- defm : VPatIntegerSetCCVL_VIPlus1_Swappable <vti, "PseudoVMSGT", SETGE, SETLE,
2181- SplatPat_simm5_plus1>;
2182- defm : VPatIntegerSetCCVL_VIPlus1_Swappable <vti, "PseudoVMSGTU", SETUGE, SETULE,
2183- SplatPat_simm5_plus1_nonzero>;
2152+ defm : VPatIntegerSetCCVL_VI_Swappable <vti, "PseudoVMSLE", SETLT, SETGT,
2153+ SplatPat_simm5_plus1>;
2154+ defm : VPatIntegerSetCCVL_VI_Swappable <vti, "PseudoVMSLEU", SETULT, SETUGT,
2155+ SplatPat_simm5_plus1_nonzero>;
2156+ defm : VPatIntegerSetCCVL_VI_Swappable <vti, "PseudoVMSGT", SETGE, SETLE,
2157+ SplatPat_simm5_plus1>;
2158+ defm : VPatIntegerSetCCVL_VI_Swappable <vti, "PseudoVMSGTU", SETUGE, SETULE,
2159+ SplatPat_simm5_plus1_nonzero>;
21842160 }
21852161} // foreach vti = AllIntegerVectors
21862162
0 commit comments