[PATCH] D118014: [RISCV] Add patterns of SET[U]LT_VI for STECC forms
Ben Shi via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 24 00:51:13 PST 2022
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG9aaa74aeeff3: [RISCV] Add patterns of SET[U]LT_VI for STECC forms (authored by Chenbing.Zheng, committed by benshi001).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D118014/new/
https://reviews.llvm.org/D118014
Files:
llvm/lib/Target/RISCV/RISCVInstrInfoVVLPatterns.td
llvm/test/CodeGen/RISCV/rvv/fixed-vectors-int-setcc.ll
Index: llvm/test/CodeGen/RISCV/rvv/fixed-vectors-int-setcc.ll
===================================================================
--- llvm/test/CodeGen/RISCV/rvv/fixed-vectors-int-setcc.ll
+++ llvm/test/CodeGen/RISCV/rvv/fixed-vectors-int-setcc.ll
@@ -553,7 +553,7 @@
; CHECK-NEXT: li a2, 64
; CHECK-NEXT: vsetvli zero, a2, e8, m4, ta, mu
; CHECK-NEXT: vle8.v v8, (a0)
-; CHECK-NEXT: vmsgt.vx v12, v8, zero
+; CHECK-NEXT: vmsgt.vi v12, v8, 0
; CHECK-NEXT: vsm.v v12, (a1)
; CHECK-NEXT: ret
%a = load <64 x i8>, <64 x i8>* %x
@@ -564,6 +564,23 @@
ret void
}
+define void @setgt_vi_v64i8_nonzero(<64 x i8>* %x, <64 x i1>* %z) {
+; CHECK-LABEL: setgt_vi_v64i8_nonzero:
+; CHECK: # %bb.0:
+; CHECK-NEXT: li a2, 64
+; CHECK-NEXT: vsetvli zero, a2, e8, m4, ta, mu
+; CHECK-NEXT: vle8.v v8, (a0)
+; CHECK-NEXT: vmsgt.vi v12, v8, 5
+; CHECK-NEXT: vsm.v v12, (a1)
+; CHECK-NEXT: ret
+ %a = load <64 x i8>, <64 x i8>* %x
+ %b = insertelement <64 x i8> undef, i8 5, i32 0
+ %c = shufflevector <64 x i8> %b, <64 x i8> undef, <64 x i32> zeroinitializer
+ %d = icmp sgt <64 x i8> %a, %c
+ store <64 x i1> %d, <64 x i1>* %z
+ ret void
+}
+
define void @setlt_vi_v128i8(<128 x i8>* %x, <128 x i1>* %z) {
; CHECK-LABEL: setlt_vi_v128i8:
; CHECK: # %bb.0:
@@ -619,8 +636,7 @@
; CHECK-NEXT: li a2, 32
; CHECK-NEXT: vsetvli zero, a2, e8, m2, ta, mu
; CHECK-NEXT: vle8.v v8, (a0)
-; CHECK-NEXT: li a0, 5
-; CHECK-NEXT: vmsgtu.vx v10, v8, a0
+; CHECK-NEXT: vmsgtu.vi v10, v8, 5
; CHECK-NEXT: vsm.v v10, (a1)
; CHECK-NEXT: ret
%a = load <32 x i8>, <32 x i8>* %x
Index: llvm/lib/Target/RISCV/RISCVInstrInfoVVLPatterns.td
===================================================================
--- llvm/lib/Target/RISCV/RISCVInstrInfoVVLPatterns.td
+++ llvm/lib/Target/RISCV/RISCVInstrInfoVVLPatterns.td
@@ -820,6 +820,8 @@
defm : VPatIntegerSetCCVL_VI_Swappable<vti, "PseudoVMSNE", SETNE, SETNE>;
defm : VPatIntegerSetCCVL_VI_Swappable<vti, "PseudoVMSLE", SETLE, SETGE>;
defm : VPatIntegerSetCCVL_VI_Swappable<vti, "PseudoVMSLEU", SETULE, SETUGE>;
+ defm : VPatIntegerSetCCVL_VI_Swappable<vti, "PseudoVMSGT", SETGT, SETLT>;
+ defm : VPatIntegerSetCCVL_VI_Swappable<vti, "PseudoVMSGTU", SETUGT, SETULT>;
defm : VPatIntegerSetCCVL_VIPlus1<vti, "PseudoVMSLE", SETLT,
SplatPat_simm5_plus1>;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D118014.402418.patch
Type: text/x-patch
Size: 2425 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220124/cfbc65fb/attachment.bin>
More information about the llvm-commits
mailing list