diff options
author | Fei Gao <gaofei@eswincomputing.com> | 2023-12-10 22:21:58 -0700 |
---|---|---|
committer | Jeff Law <jlaw@ventanamicro.com> | 2023-12-10 22:23:13 -0700 |
commit | ec201e2a6021d144797f5558e4d08a2385de7a63 (patch) | |
tree | 73ba5fccfdb635b30adcf0eed4ac201188979f0d /libgm2 | |
parent | 4719b6f5ae4d758f193a17bbd5fb6cbacd702a23 (diff) | |
download | gcc-ec201e2a6021d144797f5558e4d08a2385de7a63.zip gcc-ec201e2a6021d144797f5558e4d08a2385de7a63.tar.gz gcc-ec201e2a6021d144797f5558e4d08a2385de7a63.tar.bz2 |
[PATCH 3/5] [ifcvt] optimize x=c ? (y AND z) : y by RISC-V Zicond like insns
Take the following case for example.
CFLAGS: -march=rv64gc_zbb_zicond -mabi=lp64d -O2
long
test_AND_ceqz (long x, long y, long z, long c)
{
if (c)
x = y & z;
else
x = y;
return x;
}
Before patch:
and a2,a1,a2
czero.eqz a0,a2,a3
czero.nez a3,a1,a3
or a0,a3,a0
ret
After patch:
and a0,a1,a2
czero.nez a1,a1,a3
or a0,a1,a0
ret
Co-authored-by: Xiao Zeng<zengxiao@eswincomputing.com>
gcc/ChangeLog:
* ifcvt.cc (noce_cond_zero_binary_op_supported): Add support for AND.
(noce_bbs_ok_for_cond_zero_arith): Likewise.
(noce_try_cond_zero_arith): Likewise.
gcc/testsuite/ChangeLog:
* gcc.target/riscv/zicond_ifcvt_opt.c: Add TCs for AND.
Diffstat (limited to 'libgm2')
0 files changed, 0 insertions, 0 deletions