diff --git a/llvm/lib/Target/RISCV/RISCVInstrInfoVSDPatterns.td b/llvm/lib/Target/RISCV/RISCVInstrInfoVSDPatterns.td --- a/llvm/lib/Target/RISCV/RISCVInstrInfoVSDPatterns.td +++ b/llvm/lib/Target/RISCV/RISCVInstrInfoVSDPatterns.td @@ -24,10 +24,6 @@ def rvv_vnot : PatFrag<(ops node:$in), (xor node:$in, (riscv_vmset_vl (XLenVT srcvalue)))>; -class SwapHelper { - dag Value = !con(Prefix, !if(swap, B, A), !if(swap, A, B), Suffix); -} - multiclass VPatUSLoadStoreSDNode; } -multiclass VPatIntegerSetCCSDNode_VV { +multiclass VPatIntegerSetCCSDNode_VV { foreach vti = AllIntegerVectors in { defvar instruction = !cast(instruction_name#"_VV_"#vti.LMul.MX); def : Pat<(vti.Mask (setcc (vti.Vector vti.RegClass:$rs1), (vti.Vector vti.RegClass:$rs2), cc)), - SwapHelper<(instruction), - (instruction vti.RegClass:$rs1), - (instruction vti.RegClass:$rs2), - (instruction vti.AVL, vti.Log2SEW), - swap>.Value>; + (instruction vti.RegClass:$rs1, vti.RegClass:$rs2, vti.AVL, + vti.Log2SEW)>; + } +} + +multiclass VPatIntegerSetCCSDNode_VV_Swappable + : VPatIntegerSetCCSDNode_VV { + foreach vti = AllIntegerVectors in { + defvar instruction = !cast(instruction_name#"_VV_"#vti.LMul.MX); + def : Pat<(vti.Mask (setcc (vti.Vector vti.RegClass:$rs2), + (vti.Vector vti.RegClass:$rs1), invcc)), + (instruction vti.RegClass:$rs1, vti.RegClass:$rs2, vti.AVL, + vti.Log2SEW)>; } } -multiclass VPatIntegerSetCCSDNode_XI { + DAGOperand xop_kind> { foreach vti = AllIntegerVectors in { defvar instruction = !cast(instruction_name#_#kind#_#vti.LMul.MX); def : Pat<(vti.Mask (setcc (vti.Vector vti.RegClass:$rs1), (vti.Vector (SplatPatKind xop_kind:$rs2)), cc)), - SwapHelper<(instruction), - (instruction vti.RegClass:$rs1), - (instruction xop_kind:$rs2), - (instruction vti.AVL, vti.Log2SEW), - swap>.Value>; + (instruction vti.RegClass:$rs1, xop_kind:$rs2, vti.AVL, vti.Log2SEW)>; } } -multiclass VPatIntegerSetCCSDNode_VV_VX_VI { - defm : VPatIntegerSetCCSDNode_VV; - defm : VPatIntegerSetCCSDNode_XI; - defm : VPatIntegerSetCCSDNode_XI; +multiclass VPatIntegerSetCCSDNode_XI_Swappable + : VPatIntegerSetCCSDNode_XI { + foreach vti = AllIntegerVectors in { + defvar instruction = !cast(instruction_name#_#kind#_#vti.LMul.MX); + def : Pat<(vti.Mask (setcc (vti.Vector vti.RegClass:$rs1), + (vti.Vector (SplatPatKind xop_kind:$rs2)), cc)), + (instruction vti.RegClass:$rs1, xop_kind:$rs2, vti.AVL, vti.Log2SEW)>; + def : Pat<(vti.Mask (setcc (vti.Vector (SplatPatKind xop_kind:$rs2)), + (vti.Vector vti.RegClass:$rs1), invcc)), + (instruction vti.RegClass:$rs1, xop_kind:$rs2, vti.AVL, vti.Log2SEW)>; + } } -multiclass VPatIntegerSetCCSDNode_VV_VX { - defm : VPatIntegerSetCCSDNode_VV; - defm : VPatIntegerSetCCSDNode_XI; -} +multiclass VPatIntegerSetCCSDNode_VX_Swappable + : VPatIntegerSetCCSDNode_XI_Swappable; -multiclass VPatIntegerSetCCSDNode_VX_VI { - defm : VPatIntegerSetCCSDNode_XI; - defm : VPatIntegerSetCCSDNode_XI; -} +multiclass VPatIntegerSetCCSDNode_VI + : VPatIntegerSetCCSDNode_XI; -multiclass VPatIntegerSetCCSDNode_VIPlus1 { foreach vti = AllIntegerVectors in { defvar instruction = !cast(instruction_name#"_VI_"#vti.LMul.MX); @@ -613,29 +612,38 @@ } // 12.8. Vector Integer Comparison Instructions -defm : VPatIntegerSetCCSDNode_VV_VX_VI; -defm : VPatIntegerSetCCSDNode_VV_VX_VI; - -defm : VPatIntegerSetCCSDNode_VV_VX; -defm : VPatIntegerSetCCSDNode_VV_VX; -defm : VPatIntegerSetCCSDNode_VIPlus1; +defm : VPatIntegerSetCCSDNode_VV<"PseudoVMSNE", SETNE>; + +defm : VPatIntegerSetCCSDNode_VV_Swappable<"PseudoVMSLT", SETLT, SETGT>; +defm : VPatIntegerSetCCSDNode_VV_Swappable<"PseudoVMSLTU", SETULT, SETUGT>; +defm : VPatIntegerSetCCSDNode_VV_Swappable<"PseudoVMSLE", SETLE, SETGE>; +defm : VPatIntegerSetCCSDNode_VV_Swappable<"PseudoVMSLEU", SETULE, SETUGE>; + +defm : VPatIntegerSetCCSDNode_VX_Swappable<"PseudoVMSEQ", SETEQ, SETEQ>; +defm : VPatIntegerSetCCSDNode_VX_Swappable<"PseudoVMSNE", SETNE, SETNE>; +defm : VPatIntegerSetCCSDNode_VX_Swappable<"PseudoVMSLT", SETLT, SETGT>; +defm : VPatIntegerSetCCSDNode_VX_Swappable<"PseudoVMSLTU", SETULT, SETUGT>; +defm : VPatIntegerSetCCSDNode_VX_Swappable<"PseudoVMSLE", SETLE, SETGE>; +defm : VPatIntegerSetCCSDNode_VX_Swappable<"PseudoVMSLEU", SETULE, SETUGE>; +defm : VPatIntegerSetCCSDNode_VX_Swappable<"PseudoVMSGT", SETGT, SETLT>; +defm : VPatIntegerSetCCSDNode_VX_Swappable<"PseudoVMSGTU", SETUGT, SETULT>; +// There is no VMSGE(U)_VX instruction + +defm : VPatIntegerSetCCSDNode_VI<"PseudoVMSEQ", SETEQ>; +defm : VPatIntegerSetCCSDNode_VI<"PseudoVMSNE", SETNE>; +defm : VPatIntegerSetCCSDNode_VI<"PseudoVMSLE", SETLE>; +defm : VPatIntegerSetCCSDNode_VI<"PseudoVMSLEU", SETULE>; +defm : VPatIntegerSetCCSDNode_VI<"PseudoVMSGT", SETGT>; +defm : VPatIntegerSetCCSDNode_VI<"PseudoVMSGTU", SETUGT>; + +defm : VPatIntegerSetCCSDNode_VIPlus1<"PseudoVMSLE", SETLT, SplatPat_simm5_plus1_nonzero>; -defm : VPatIntegerSetCCSDNode_VIPlus1; - -defm : VPatIntegerSetCCSDNode_VV; -defm : VPatIntegerSetCCSDNode_VV; -defm : VPatIntegerSetCCSDNode_VX_VI; -defm : VPatIntegerSetCCSDNode_VX_VI; - -defm : VPatIntegerSetCCSDNode_VV_VX_VI; -defm : VPatIntegerSetCCSDNode_VV_VX_VI; - -defm : VPatIntegerSetCCSDNode_VV; -defm : VPatIntegerSetCCSDNode_VV; -defm : VPatIntegerSetCCSDNode_VIPlus1; -defm : VPatIntegerSetCCSDNode_VIPlus1; // 12.9. Vector Integer Min/Max Instructions diff --git a/llvm/lib/Target/RISCV/RISCVInstrInfoVVLPatterns.td b/llvm/lib/Target/RISCV/RISCVInstrInfoVVLPatterns.td --- a/llvm/lib/Target/RISCV/RISCVInstrInfoVVLPatterns.td +++ b/llvm/lib/Target/RISCV/RISCVInstrInfoVVLPatterns.td @@ -464,8 +464,8 @@ // Inherits from VPatIntegerSetCCVL_VV and adds a pattern with operands swapped. multiclass VPatIntegerSetCCVL_VV_Swappable : - VPatIntegerSetCCVL_VV { + CondCode cc, CondCode invcc> + : VPatIntegerSetCCVL_VV { def : Pat<(vti.Mask (riscv_setcc_vl (vti.Vector vti.RegClass:$rs2), vti.RegClass:$rs1, invcc, (vti.Mask V0), diff --git a/llvm/test/CodeGen/RISCV/rvv/cttz-sdnode.ll b/llvm/test/CodeGen/RISCV/rvv/cttz-sdnode.ll --- a/llvm/test/CodeGen/RISCV/rvv/cttz-sdnode.ll +++ b/llvm/test/CodeGen/RISCV/rvv/cttz-sdnode.ll @@ -50,8 +50,7 @@ ; RV32D-LABEL: cttz_nxv1i8: ; RV32D: # %bb.0: ; RV32D-NEXT: vsetvli a0, zero, e8, mf8, ta, mu -; RV32D-NEXT: vmv.v.i v9, 0 -; RV32D-NEXT: vmseq.vv v0, v9, v8 +; RV32D-NEXT: vmseq.vx v0, v8, zero ; RV32D-NEXT: vrsub.vi v9, v8, 0 ; RV32D-NEXT: vand.vv v8, v8, v9 ; RV32D-NEXT: vsetvli zero, zero, e32, mf2, ta, mu @@ -69,8 +68,7 @@ ; RV64D-LABEL: cttz_nxv1i8: ; RV64D: # %bb.0: ; RV64D-NEXT: vsetvli a0, zero, e8, mf8, ta, mu -; RV64D-NEXT: vmv.v.i v9, 0 -; RV64D-NEXT: vmseq.vv v0, v9, v8 +; RV64D-NEXT: vmseq.vx v0, v8, zero ; RV64D-NEXT: vrsub.vi v9, v8, 0 ; RV64D-NEXT: vand.vv v8, v8, v9 ; RV64D-NEXT: vsetvli zero, zero, e32, mf2, ta, mu @@ -135,8 +133,7 @@ ; RV32D-LABEL: cttz_nxv2i8: ; RV32D: # %bb.0: ; RV32D-NEXT: vsetvli a0, zero, e8, mf4, ta, mu -; RV32D-NEXT: vmv.v.i v9, 0 -; RV32D-NEXT: vmseq.vv v0, v9, v8 +; RV32D-NEXT: vmseq.vx v0, v8, zero ; RV32D-NEXT: vrsub.vi v9, v8, 0 ; RV32D-NEXT: vand.vv v8, v8, v9 ; RV32D-NEXT: vsetvli zero, zero, e32, m1, ta, mu @@ -154,8 +151,7 @@ ; RV64D-LABEL: cttz_nxv2i8: ; RV64D: # %bb.0: ; RV64D-NEXT: vsetvli a0, zero, e8, mf4, ta, mu -; RV64D-NEXT: vmv.v.i v9, 0 -; RV64D-NEXT: vmseq.vv v0, v9, v8 +; RV64D-NEXT: vmseq.vx v0, v8, zero ; RV64D-NEXT: vrsub.vi v9, v8, 0 ; RV64D-NEXT: vand.vv v8, v8, v9 ; RV64D-NEXT: vsetvli zero, zero, e32, m1, ta, mu @@ -220,8 +216,7 @@ ; RV32D-LABEL: cttz_nxv4i8: ; RV32D: # %bb.0: ; RV32D-NEXT: vsetvli a0, zero, e8, mf2, ta, mu -; RV32D-NEXT: vmv.v.i v9, 0 -; RV32D-NEXT: vmseq.vv v0, v9, v8 +; RV32D-NEXT: vmseq.vx v0, v8, zero ; RV32D-NEXT: vrsub.vi v9, v8, 0 ; RV32D-NEXT: vand.vv v8, v8, v9 ; RV32D-NEXT: vsetvli zero, zero, e32, m2, ta, mu @@ -239,8 +234,7 @@ ; RV64D-LABEL: cttz_nxv4i8: ; RV64D: # %bb.0: ; RV64D-NEXT: vsetvli a0, zero, e8, mf2, ta, mu -; RV64D-NEXT: vmv.v.i v9, 0 -; RV64D-NEXT: vmseq.vv v0, v9, v8 +; RV64D-NEXT: vmseq.vx v0, v8, zero ; RV64D-NEXT: vrsub.vi v9, v8, 0 ; RV64D-NEXT: vand.vv v8, v8, v9 ; RV64D-NEXT: vsetvli zero, zero, e32, m2, ta, mu @@ -305,8 +299,7 @@ ; RV32D-LABEL: cttz_nxv8i8: ; RV32D: # %bb.0: ; RV32D-NEXT: vsetvli a0, zero, e8, m1, ta, mu -; RV32D-NEXT: vmv.v.i v9, 0 -; RV32D-NEXT: vmseq.vv v0, v9, v8 +; RV32D-NEXT: vmseq.vx v0, v8, zero ; RV32D-NEXT: vrsub.vi v9, v8, 0 ; RV32D-NEXT: vand.vv v8, v8, v9 ; RV32D-NEXT: vsetvli zero, zero, e32, m4, ta, mu @@ -324,8 +317,7 @@ ; RV64D-LABEL: cttz_nxv8i8: ; RV64D: # %bb.0: ; RV64D-NEXT: vsetvli a0, zero, e8, m1, ta, mu -; RV64D-NEXT: vmv.v.i v9, 0 -; RV64D-NEXT: vmseq.vv v0, v9, v8 +; RV64D-NEXT: vmseq.vx v0, v8, zero ; RV64D-NEXT: vrsub.vi v9, v8, 0 ; RV64D-NEXT: vand.vv v8, v8, v9 ; RV64D-NEXT: vsetvli zero, zero, e32, m4, ta, mu @@ -390,8 +382,7 @@ ; RV32D-LABEL: cttz_nxv16i8: ; RV32D: # %bb.0: ; RV32D-NEXT: vsetvli a0, zero, e8, m2, ta, mu -; RV32D-NEXT: vmv.v.i v10, 0 -; RV32D-NEXT: vmseq.vv v0, v10, v8 +; RV32D-NEXT: vmseq.vx v0, v8, zero ; RV32D-NEXT: vrsub.vi v10, v8, 0 ; RV32D-NEXT: vand.vv v8, v8, v10 ; RV32D-NEXT: vsetvli zero, zero, e32, m8, ta, mu @@ -409,8 +400,7 @@ ; RV64D-LABEL: cttz_nxv16i8: ; RV64D: # %bb.0: ; RV64D-NEXT: vsetvli a0, zero, e8, m2, ta, mu -; RV64D-NEXT: vmv.v.i v10, 0 -; RV64D-NEXT: vmseq.vv v0, v10, v8 +; RV64D-NEXT: vmseq.vx v0, v8, zero ; RV64D-NEXT: vrsub.vi v10, v8, 0 ; RV64D-NEXT: vand.vv v8, v8, v10 ; RV64D-NEXT: vsetvli zero, zero, e32, m8, ta, mu @@ -541,8 +531,7 @@ ; RV32D-LABEL: cttz_nxv1i16: ; RV32D: # %bb.0: ; RV32D-NEXT: vsetvli a0, zero, e16, mf4, ta, mu -; RV32D-NEXT: vmv.v.i v9, 0 -; RV32D-NEXT: vmseq.vv v0, v9, v8 +; RV32D-NEXT: vmseq.vx v0, v8, zero ; RV32D-NEXT: vrsub.vi v9, v8, 0 ; RV32D-NEXT: vand.vv v8, v8, v9 ; RV32D-NEXT: vfwcvt.f.xu.v v9, v8 @@ -556,8 +545,7 @@ ; RV64D-LABEL: cttz_nxv1i16: ; RV64D: # %bb.0: ; RV64D-NEXT: vsetvli a0, zero, e16, mf4, ta, mu -; RV64D-NEXT: vmv.v.i v9, 0 -; RV64D-NEXT: vmseq.vv v0, v9, v8 +; RV64D-NEXT: vmseq.vx v0, v8, zero ; RV64D-NEXT: vrsub.vi v9, v8, 0 ; RV64D-NEXT: vand.vv v8, v8, v9 ; RV64D-NEXT: vfwcvt.f.xu.v v9, v8 @@ -632,8 +620,7 @@ ; RV32D-LABEL: cttz_nxv2i16: ; RV32D: # %bb.0: ; RV32D-NEXT: vsetvli a0, zero, e16, mf2, ta, mu -; RV32D-NEXT: vmv.v.i v9, 0 -; RV32D-NEXT: vmseq.vv v0, v9, v8 +; RV32D-NEXT: vmseq.vx v0, v8, zero ; RV32D-NEXT: vrsub.vi v9, v8, 0 ; RV32D-NEXT: vand.vv v8, v8, v9 ; RV32D-NEXT: vfwcvt.f.xu.v v9, v8 @@ -647,8 +634,7 @@ ; RV64D-LABEL: cttz_nxv2i16: ; RV64D: # %bb.0: ; RV64D-NEXT: vsetvli a0, zero, e16, mf2, ta, mu -; RV64D-NEXT: vmv.v.i v9, 0 -; RV64D-NEXT: vmseq.vv v0, v9, v8 +; RV64D-NEXT: vmseq.vx v0, v8, zero ; RV64D-NEXT: vrsub.vi v9, v8, 0 ; RV64D-NEXT: vand.vv v8, v8, v9 ; RV64D-NEXT: vfwcvt.f.xu.v v9, v8 @@ -723,8 +709,7 @@ ; RV32D-LABEL: cttz_nxv4i16: ; RV32D: # %bb.0: ; RV32D-NEXT: vsetvli a0, zero, e16, m1, ta, mu -; RV32D-NEXT: vmv.v.i v9, 0 -; RV32D-NEXT: vmseq.vv v0, v9, v8 +; RV32D-NEXT: vmseq.vx v0, v8, zero ; RV32D-NEXT: vrsub.vi v9, v8, 0 ; RV32D-NEXT: vand.vv v8, v8, v9 ; RV32D-NEXT: vfwcvt.f.xu.v v10, v8 @@ -738,8 +723,7 @@ ; RV64D-LABEL: cttz_nxv4i16: ; RV64D: # %bb.0: ; RV64D-NEXT: vsetvli a0, zero, e16, m1, ta, mu -; RV64D-NEXT: vmv.v.i v9, 0 -; RV64D-NEXT: vmseq.vv v0, v9, v8 +; RV64D-NEXT: vmseq.vx v0, v8, zero ; RV64D-NEXT: vrsub.vi v9, v8, 0 ; RV64D-NEXT: vand.vv v8, v8, v9 ; RV64D-NEXT: vfwcvt.f.xu.v v10, v8 @@ -814,8 +798,7 @@ ; RV32D-LABEL: cttz_nxv8i16: ; RV32D: # %bb.0: ; RV32D-NEXT: vsetvli a0, zero, e16, m2, ta, mu -; RV32D-NEXT: vmv.v.i v10, 0 -; RV32D-NEXT: vmseq.vv v0, v10, v8 +; RV32D-NEXT: vmseq.vx v0, v8, zero ; RV32D-NEXT: vrsub.vi v10, v8, 0 ; RV32D-NEXT: vand.vv v8, v8, v10 ; RV32D-NEXT: vfwcvt.f.xu.v v12, v8 @@ -829,8 +812,7 @@ ; RV64D-LABEL: cttz_nxv8i16: ; RV64D: # %bb.0: ; RV64D-NEXT: vsetvli a0, zero, e16, m2, ta, mu -; RV64D-NEXT: vmv.v.i v10, 0 -; RV64D-NEXT: vmseq.vv v0, v10, v8 +; RV64D-NEXT: vmseq.vx v0, v8, zero ; RV64D-NEXT: vrsub.vi v10, v8, 0 ; RV64D-NEXT: vand.vv v8, v8, v10 ; RV64D-NEXT: vfwcvt.f.xu.v v12, v8 @@ -905,8 +887,7 @@ ; RV32D-LABEL: cttz_nxv16i16: ; RV32D: # %bb.0: ; RV32D-NEXT: vsetvli a0, zero, e16, m4, ta, mu -; RV32D-NEXT: vmv.v.i v12, 0 -; RV32D-NEXT: vmseq.vv v0, v12, v8 +; RV32D-NEXT: vmseq.vx v0, v8, zero ; RV32D-NEXT: vrsub.vi v12, v8, 0 ; RV32D-NEXT: vand.vv v8, v8, v12 ; RV32D-NEXT: vfwcvt.f.xu.v v16, v8 @@ -920,8 +901,7 @@ ; RV64D-LABEL: cttz_nxv16i16: ; RV64D: # %bb.0: ; RV64D-NEXT: vsetvli a0, zero, e16, m4, ta, mu -; RV64D-NEXT: vmv.v.i v12, 0 -; RV64D-NEXT: vmseq.vv v0, v12, v8 +; RV64D-NEXT: vmseq.vx v0, v8, zero ; RV64D-NEXT: vrsub.vi v12, v8, 0 ; RV64D-NEXT: vand.vv v8, v8, v12 ; RV64D-NEXT: vfwcvt.f.xu.v v16, v8 @@ -1077,8 +1057,7 @@ ; RV64D-LABEL: cttz_nxv1i32: ; RV64D: # %bb.0: ; RV64D-NEXT: vsetvli a0, zero, e32, mf2, ta, mu -; RV64D-NEXT: vmv.v.i v9, 0 -; RV64D-NEXT: vmseq.vv v0, v9, v8 +; RV64D-NEXT: vmseq.vx v0, v8, zero ; RV64D-NEXT: vrsub.vi v9, v8, 0 ; RV64D-NEXT: vand.vv v8, v8, v9 ; RV64D-NEXT: vfwcvt.f.xu.v v9, v8 @@ -1177,8 +1156,7 @@ ; RV64D-LABEL: cttz_nxv2i32: ; RV64D: # %bb.0: ; RV64D-NEXT: vsetvli a0, zero, e32, m1, ta, mu -; RV64D-NEXT: vmv.v.i v9, 0 -; RV64D-NEXT: vmseq.vv v0, v9, v8 +; RV64D-NEXT: vmseq.vx v0, v8, zero ; RV64D-NEXT: vrsub.vi v9, v8, 0 ; RV64D-NEXT: vand.vv v8, v8, v9 ; RV64D-NEXT: vfwcvt.f.xu.v v10, v8 @@ -1277,8 +1255,7 @@ ; RV64D-LABEL: cttz_nxv4i32: ; RV64D: # %bb.0: ; RV64D-NEXT: vsetvli a0, zero, e32, m2, ta, mu -; RV64D-NEXT: vmv.v.i v10, 0 -; RV64D-NEXT: vmseq.vv v0, v10, v8 +; RV64D-NEXT: vmseq.vx v0, v8, zero ; RV64D-NEXT: vrsub.vi v10, v8, 0 ; RV64D-NEXT: vand.vv v8, v8, v10 ; RV64D-NEXT: vfwcvt.f.xu.v v12, v8 @@ -1377,8 +1354,7 @@ ; RV64D-LABEL: cttz_nxv8i32: ; RV64D: # %bb.0: ; RV64D-NEXT: vsetvli a0, zero, e32, m4, ta, mu -; RV64D-NEXT: vmv.v.i v12, 0 -; RV64D-NEXT: vmseq.vv v0, v12, v8 +; RV64D-NEXT: vmseq.vx v0, v8, zero ; RV64D-NEXT: vrsub.vi v12, v8, 0 ; RV64D-NEXT: vand.vv v8, v8, v12 ; RV64D-NEXT: vfwcvt.f.xu.v v16, v8 diff --git a/llvm/test/CodeGen/RISCV/rvv/setcc-integer.ll b/llvm/test/CodeGen/RISCV/rvv/setcc-integer.ll --- a/llvm/test/CodeGen/RISCV/rvv/setcc-integer.ll +++ b/llvm/test/CodeGen/RISCV/rvv/setcc-integer.ll @@ -30,8 +30,7 @@ ; CHECK-LABEL: icmp_eq_xv_nxv8i8: ; CHECK: # %bb.0: ; CHECK-NEXT: vsetvli a1, zero, e8, m1, ta, mu -; CHECK-NEXT: vmv.v.x v9, a0 -; CHECK-NEXT: vmseq.vv v0, v9, v8 +; CHECK-NEXT: vmseq.vx v0, v8, a0 ; CHECK-NEXT: ret %head = insertelement poison, i8 %b, i32 0 %splat = shufflevector %head, poison, zeroinitializer @@ -101,8 +100,7 @@ ; CHECK-LABEL: icmp_ne_xv_nxv8i8: ; CHECK: # %bb.0: ; CHECK-NEXT: vsetvli a1, zero, e8, m1, ta, mu -; CHECK-NEXT: vmv.v.x v9, a0 -; CHECK-NEXT: vmsne.vv v0, v9, v8 +; CHECK-NEXT: vmsne.vx v0, v8, a0 ; CHECK-NEXT: ret %head = insertelement poison, i8 %b, i32 0 %splat = shufflevector %head, poison, zeroinitializer @@ -148,8 +146,7 @@ ; CHECK-LABEL: icmp_ugt_xv_nxv8i8: ; CHECK: # %bb.0: ; CHECK-NEXT: vsetvli a1, zero, e8, m1, ta, mu -; CHECK-NEXT: vmv.v.x v9, a0 -; CHECK-NEXT: vmsltu.vv v0, v8, v9 +; CHECK-NEXT: vmsltu.vx v0, v8, a0 ; CHECK-NEXT: ret %head = insertelement poison, i8 %b, i32 0 %splat = shufflevector %head, poison, zeroinitializer @@ -196,8 +193,7 @@ ; CHECK-LABEL: icmp_uge_xv_nxv8i8: ; CHECK: # %bb.0: ; CHECK-NEXT: vsetvli a1, zero, e8, m1, ta, mu -; CHECK-NEXT: vmv.v.x v9, a0 -; CHECK-NEXT: vmsleu.vv v0, v8, v9 +; CHECK-NEXT: vmsleu.vx v0, v8, a0 ; CHECK-NEXT: ret %head = insertelement poison, i8 %b, i32 0 %splat = shufflevector %head, poison, zeroinitializer @@ -330,8 +326,7 @@ ; CHECK-LABEL: icmp_ult_xv_nxv8i8: ; CHECK: # %bb.0: ; CHECK-NEXT: vsetvli a1, zero, e8, m1, ta, mu -; CHECK-NEXT: vmv.v.x v9, a0 -; CHECK-NEXT: vmsltu.vv v0, v9, v8 +; CHECK-NEXT: vmsgtu.vx v0, v8, a0 ; CHECK-NEXT: ret %head = insertelement poison, i8 %b, i32 0 %splat = shufflevector %head, poison, zeroinitializer @@ -499,8 +494,7 @@ ; CHECK-LABEL: icmp_sgt_xv_nxv8i8: ; CHECK: # %bb.0: ; CHECK-NEXT: vsetvli a1, zero, e8, m1, ta, mu -; CHECK-NEXT: vmv.v.x v9, a0 -; CHECK-NEXT: vmslt.vv v0, v8, v9 +; CHECK-NEXT: vmslt.vx v0, v8, a0 ; CHECK-NEXT: ret %head = insertelement poison, i8 %b, i32 0 %splat = shufflevector %head, poison, zeroinitializer @@ -547,8 +541,7 @@ ; CHECK-LABEL: icmp_sge_xv_nxv8i8: ; CHECK: # %bb.0: ; CHECK-NEXT: vsetvli a1, zero, e8, m1, ta, mu -; CHECK-NEXT: vmv.v.x v9, a0 -; CHECK-NEXT: vmsle.vv v0, v8, v9 +; CHECK-NEXT: vmsle.vx v0, v8, a0 ; CHECK-NEXT: ret %head = insertelement poison, i8 %b, i32 0 %splat = shufflevector %head, poison, zeroinitializer @@ -643,8 +636,7 @@ ; CHECK-LABEL: icmp_slt_xv_nxv8i8: ; CHECK: # %bb.0: ; CHECK-NEXT: vsetvli a1, zero, e8, m1, ta, mu -; CHECK-NEXT: vmv.v.x v9, a0 -; CHECK-NEXT: vmslt.vv v0, v9, v8 +; CHECK-NEXT: vmsgt.vx v0, v8, a0 ; CHECK-NEXT: ret %head = insertelement poison, i8 %b, i32 0 %splat = shufflevector %head, poison, zeroinitializer @@ -786,8 +778,7 @@ ; CHECK-LABEL: icmp_eq_xv_nxv8i16: ; CHECK: # %bb.0: ; CHECK-NEXT: vsetvli a1, zero, e16, m2, ta, mu -; CHECK-NEXT: vmv.v.x v10, a0 -; CHECK-NEXT: vmseq.vv v0, v10, v8 +; CHECK-NEXT: vmseq.vx v0, v8, a0 ; CHECK-NEXT: ret %head = insertelement poison, i16 %b, i32 0 %splat = shufflevector %head, poison, zeroinitializer @@ -857,8 +848,7 @@ ; CHECK-LABEL: icmp_ne_xv_nxv8i16: ; CHECK: # %bb.0: ; CHECK-NEXT: vsetvli a1, zero, e16, m2, ta, mu -; CHECK-NEXT: vmv.v.x v10, a0 -; CHECK-NEXT: vmsne.vv v0, v10, v8 +; CHECK-NEXT: vmsne.vx v0, v8, a0 ; CHECK-NEXT: ret %head = insertelement poison, i16 %b, i32 0 %splat = shufflevector %head, poison, zeroinitializer @@ -904,8 +894,7 @@ ; CHECK-LABEL: icmp_ugt_xv_nxv8i16: ; CHECK: # %bb.0: ; CHECK-NEXT: vsetvli a1, zero, e16, m2, ta, mu -; CHECK-NEXT: vmv.v.x v10, a0 -; CHECK-NEXT: vmsltu.vv v0, v8, v10 +; CHECK-NEXT: vmsltu.vx v0, v8, a0 ; CHECK-NEXT: ret %head = insertelement poison, i16 %b, i32 0 %splat = shufflevector %head, poison, zeroinitializer @@ -952,8 +941,7 @@ ; CHECK-LABEL: icmp_uge_xv_nxv8i16: ; CHECK: # %bb.0: ; CHECK-NEXT: vsetvli a1, zero, e16, m2, ta, mu -; CHECK-NEXT: vmv.v.x v10, a0 -; CHECK-NEXT: vmsleu.vv v0, v8, v10 +; CHECK-NEXT: vmsleu.vx v0, v8, a0 ; CHECK-NEXT: ret %head = insertelement poison, i16 %b, i32 0 %splat = shufflevector %head, poison, zeroinitializer @@ -1072,8 +1060,7 @@ ; CHECK-LABEL: icmp_ult_xv_nxv8i16: ; CHECK: # %bb.0: ; CHECK-NEXT: vsetvli a1, zero, e16, m2, ta, mu -; CHECK-NEXT: vmv.v.x v10, a0 -; CHECK-NEXT: vmsltu.vv v0, v10, v8 +; CHECK-NEXT: vmsgtu.vx v0, v8, a0 ; CHECK-NEXT: ret %head = insertelement poison, i16 %b, i32 0 %splat = shufflevector %head, poison, zeroinitializer @@ -1227,8 +1214,7 @@ ; CHECK-LABEL: icmp_sgt_xv_nxv8i16: ; CHECK: # %bb.0: ; CHECK-NEXT: vsetvli a1, zero, e16, m2, ta, mu -; CHECK-NEXT: vmv.v.x v10, a0 -; CHECK-NEXT: vmslt.vv v0, v8, v10 +; CHECK-NEXT: vmslt.vx v0, v8, a0 ; CHECK-NEXT: ret %head = insertelement poison, i16 %b, i32 0 %splat = shufflevector %head, poison, zeroinitializer @@ -1275,8 +1261,7 @@ ; CHECK-LABEL: icmp_sge_xv_nxv8i16: ; CHECK: # %bb.0: ; CHECK-NEXT: vsetvli a1, zero, e16, m2, ta, mu -; CHECK-NEXT: vmv.v.x v10, a0 -; CHECK-NEXT: vmsle.vv v0, v8, v10 +; CHECK-NEXT: vmsle.vx v0, v8, a0 ; CHECK-NEXT: ret %head = insertelement poison, i16 %b, i32 0 %splat = shufflevector %head, poison, zeroinitializer @@ -1371,8 +1356,7 @@ ; CHECK-LABEL: icmp_slt_xv_nxv8i16: ; CHECK: # %bb.0: ; CHECK-NEXT: vsetvli a1, zero, e16, m2, ta, mu -; CHECK-NEXT: vmv.v.x v10, a0 -; CHECK-NEXT: vmslt.vv v0, v10, v8 +; CHECK-NEXT: vmsgt.vx v0, v8, a0 ; CHECK-NEXT: ret %head = insertelement poison, i16 %b, i32 0 %splat = shufflevector %head, poison, zeroinitializer @@ -1514,8 +1498,7 @@ ; CHECK-LABEL: icmp_eq_xv_nxv8i32: ; CHECK: # %bb.0: ; CHECK-NEXT: vsetvli a1, zero, e32, m4, ta, mu -; CHECK-NEXT: vmv.v.x v12, a0 -; CHECK-NEXT: vmseq.vv v0, v12, v8 +; CHECK-NEXT: vmseq.vx v0, v8, a0 ; CHECK-NEXT: ret %head = insertelement poison, i32 %b, i32 0 %splat = shufflevector %head, poison, zeroinitializer @@ -1585,8 +1568,7 @@ ; CHECK-LABEL: icmp_ne_xv_nxv8i32: ; CHECK: # %bb.0: ; CHECK-NEXT: vsetvli a1, zero, e32, m4, ta, mu -; CHECK-NEXT: vmv.v.x v12, a0 -; CHECK-NEXT: vmsne.vv v0, v12, v8 +; CHECK-NEXT: vmsne.vx v0, v8, a0 ; CHECK-NEXT: ret %head = insertelement poison, i32 %b, i32 0 %splat = shufflevector %head, poison, zeroinitializer @@ -1632,8 +1614,7 @@ ; CHECK-LABEL: icmp_ugt_xv_nxv8i32: ; CHECK: # %bb.0: ; CHECK-NEXT: vsetvli a1, zero, e32, m4, ta, mu -; CHECK-NEXT: vmv.v.x v12, a0 -; CHECK-NEXT: vmsltu.vv v0, v8, v12 +; CHECK-NEXT: vmsltu.vx v0, v8, a0 ; CHECK-NEXT: ret %head = insertelement poison, i32 %b, i32 0 %splat = shufflevector %head, poison, zeroinitializer @@ -1680,8 +1661,7 @@ ; CHECK-LABEL: icmp_uge_xv_nxv8i32: ; CHECK: # %bb.0: ; CHECK-NEXT: vsetvli a1, zero, e32, m4, ta, mu -; CHECK-NEXT: vmv.v.x v12, a0 -; CHECK-NEXT: vmsleu.vv v0, v8, v12 +; CHECK-NEXT: vmsleu.vx v0, v8, a0 ; CHECK-NEXT: ret %head = insertelement poison, i32 %b, i32 0 %splat = shufflevector %head, poison, zeroinitializer @@ -1800,8 +1780,7 @@ ; CHECK-LABEL: icmp_ult_xv_nxv8i32: ; CHECK: # %bb.0: ; CHECK-NEXT: vsetvli a1, zero, e32, m4, ta, mu -; CHECK-NEXT: vmv.v.x v12, a0 -; CHECK-NEXT: vmsltu.vv v0, v12, v8 +; CHECK-NEXT: vmsgtu.vx v0, v8, a0 ; CHECK-NEXT: ret %head = insertelement poison, i32 %b, i32 0 %splat = shufflevector %head, poison, zeroinitializer @@ -1955,8 +1934,7 @@ ; CHECK-LABEL: icmp_sgt_xv_nxv8i32: ; CHECK: # %bb.0: ; CHECK-NEXT: vsetvli a1, zero, e32, m4, ta, mu -; CHECK-NEXT: vmv.v.x v12, a0 -; CHECK-NEXT: vmslt.vv v0, v8, v12 +; CHECK-NEXT: vmslt.vx v0, v8, a0 ; CHECK-NEXT: ret %head = insertelement poison, i32 %b, i32 0 %splat = shufflevector %head, poison, zeroinitializer @@ -2003,8 +1981,7 @@ ; CHECK-LABEL: icmp_sge_xv_nxv8i32: ; CHECK: # %bb.0: ; CHECK-NEXT: vsetvli a1, zero, e32, m4, ta, mu -; CHECK-NEXT: vmv.v.x v12, a0 -; CHECK-NEXT: vmsle.vv v0, v8, v12 +; CHECK-NEXT: vmsle.vx v0, v8, a0 ; CHECK-NEXT: ret %head = insertelement poison, i32 %b, i32 0 %splat = shufflevector %head, poison, zeroinitializer @@ -2099,8 +2076,7 @@ ; CHECK-LABEL: icmp_slt_xv_nxv8i32: ; CHECK: # %bb.0: ; CHECK-NEXT: vsetvli a1, zero, e32, m4, ta, mu -; CHECK-NEXT: vmv.v.x v12, a0 -; CHECK-NEXT: vmslt.vv v0, v12, v8 +; CHECK-NEXT: vmsgt.vx v0, v8, a0 ; CHECK-NEXT: ret %head = insertelement poison, i32 %b, i32 0 %splat = shufflevector %head, poison, zeroinitializer @@ -2268,8 +2244,7 @@ ; RV64-LABEL: icmp_eq_xv_nxv8i64: ; RV64: # %bb.0: ; RV64-NEXT: vsetvli a1, zero, e64, m8, ta, mu -; RV64-NEXT: vmv.v.x v16, a0 -; RV64-NEXT: vmseq.vv v0, v16, v8 +; RV64-NEXT: vmseq.vx v0, v8, a0 ; RV64-NEXT: ret %head = insertelement poison, i64 %b, i32 0 %splat = shufflevector %head, poison, zeroinitializer @@ -2365,8 +2340,7 @@ ; RV64-LABEL: icmp_ne_xv_nxv8i64: ; RV64: # %bb.0: ; RV64-NEXT: vsetvli a1, zero, e64, m8, ta, mu -; RV64-NEXT: vmv.v.x v16, a0 -; RV64-NEXT: vmsne.vv v0, v16, v8 +; RV64-NEXT: vmsne.vx v0, v8, a0 ; RV64-NEXT: ret %head = insertelement poison, i64 %b, i32 0 %splat = shufflevector %head, poison, zeroinitializer @@ -2438,8 +2412,7 @@ ; RV64-LABEL: icmp_ugt_xv_nxv8i64: ; RV64: # %bb.0: ; RV64-NEXT: vsetvli a1, zero, e64, m8, ta, mu -; RV64-NEXT: vmv.v.x v16, a0 -; RV64-NEXT: vmsltu.vv v0, v8, v16 +; RV64-NEXT: vmsltu.vx v0, v8, a0 ; RV64-NEXT: ret %head = insertelement poison, i64 %b, i32 0 %splat = shufflevector %head, poison, zeroinitializer @@ -2512,8 +2485,7 @@ ; RV64-LABEL: icmp_uge_xv_nxv8i64: ; RV64: # %bb.0: ; RV64-NEXT: vsetvli a1, zero, e64, m8, ta, mu -; RV64-NEXT: vmv.v.x v16, a0 -; RV64-NEXT: vmsleu.vv v0, v8, v16 +; RV64-NEXT: vmsleu.vx v0, v8, a0 ; RV64-NEXT: ret %head = insertelement poison, i64 %b, i32 0 %splat = shufflevector %head, poison, zeroinitializer @@ -2658,8 +2630,7 @@ ; RV64-LABEL: icmp_ult_xv_nxv8i64: ; RV64: # %bb.0: ; RV64-NEXT: vsetvli a1, zero, e64, m8, ta, mu -; RV64-NEXT: vmv.v.x v16, a0 -; RV64-NEXT: vmsltu.vv v0, v16, v8 +; RV64-NEXT: vmsgtu.vx v0, v8, a0 ; RV64-NEXT: ret %head = insertelement poison, i64 %b, i32 0 %splat = shufflevector %head, poison, zeroinitializer @@ -2865,8 +2836,7 @@ ; RV64-LABEL: icmp_sgt_xv_nxv8i64: ; RV64: # %bb.0: ; RV64-NEXT: vsetvli a1, zero, e64, m8, ta, mu -; RV64-NEXT: vmv.v.x v16, a0 -; RV64-NEXT: vmslt.vv v0, v8, v16 +; RV64-NEXT: vmslt.vx v0, v8, a0 ; RV64-NEXT: ret %head = insertelement poison, i64 %b, i32 0 %splat = shufflevector %head, poison, zeroinitializer @@ -2939,8 +2909,7 @@ ; RV64-LABEL: icmp_sge_xv_nxv8i64: ; RV64: # %bb.0: ; RV64-NEXT: vsetvli a1, zero, e64, m8, ta, mu -; RV64-NEXT: vmv.v.x v16, a0 -; RV64-NEXT: vmsle.vv v0, v8, v16 +; RV64-NEXT: vmsle.vx v0, v8, a0 ; RV64-NEXT: ret %head = insertelement poison, i64 %b, i32 0 %splat = shufflevector %head, poison, zeroinitializer @@ -3061,8 +3030,7 @@ ; RV64-LABEL: icmp_slt_xv_nxv8i64: ; RV64: # %bb.0: ; RV64-NEXT: vsetvli a1, zero, e64, m8, ta, mu -; RV64-NEXT: vmv.v.x v16, a0 -; RV64-NEXT: vmslt.vv v0, v16, v8 +; RV64-NEXT: vmsgt.vx v0, v8, a0 ; RV64-NEXT: ret %head = insertelement poison, i64 %b, i32 0 %splat = shufflevector %head, poison, zeroinitializer