aboutsummaryrefslogtreecommitdiff
path: root/gcc/combine.cc
diff options
context:
space:
mode:
authorPan Li <pan2.li@intel.com>2023-04-28 23:21:02 +0800
committerKito Cheng <kito.cheng@sifive.com>2023-05-05 22:50:43 +0800
commit3365956d55a6484097ff40fb81acb2345322044c (patch)
tree8e40bbef15286dd3f60a7b9925144d60b59a6701 /gcc/combine.cc
parentbb043cd3da5a11a98454478ac71057d6351c2653 (diff)
downloadgcc-3365956d55a6484097ff40fb81acb2345322044c.zip
gcc-3365956d55a6484097ff40fb81acb2345322044c.tar.gz
gcc-3365956d55a6484097ff40fb81acb2345322044c.tar.bz2
RISC-V: Allow RVV VMS{Compare}(V1, V1) simplify to VMSET
When some RVV integer compare operators act on the same vector registers without mask. They can be simplified to VMSET. This PATCH allows the eq, le, leu, ge, geu to perform such kind of the simplification by adding one macro in riscv for simplify rtx. Given we have: vbool1_t test_shortcut_for_riscv_vmseq_case_0(vint8m8_t v1, size_t vl) { return __riscv_vmseq_vv_i8m8_b1(v1, v1, vl); } Before this patch: vsetvli zero,a2,e8,m8,ta,ma vl8re8.v v8,0(a1) vmseq.vv v8,v8,v8 vsetvli a5,zero,e8,m8,ta,ma vsm.v v8,0(a0) ret After this patch: vsetvli zero,a2,e8,m8,ta,ma vmset.m v1 <- optimized to vmset.m vsetvli a5,zero,e8,m8,ta,ma vsm.v v1,0(a0) ret As above, we may have one instruction eliminated and require less vector registers. Signed-off-by: Pan Li <pan2.li@intel.com> gcc/ChangeLog: * config/riscv/riscv.h (VECTOR_STORE_FLAG_VALUE): Add new macro consumed by simplify_rtx. gcc/testsuite/ChangeLog: * gcc.target/riscv/rvv/base/integer_compare_insn_shortcut.c: Adjust test check condition.
Diffstat (limited to 'gcc/combine.cc')
0 files changed, 0 insertions, 0 deletions