On 10/30/23 01:25, Fei Gao wrote:
TARGET_HAVE_COND_ZERO is added to control ifcvt optimization
for targets with RISC-V Zicond like insns.
Co-authored-by: Xiao Zeng<zengx...@eswincomputing.com>
gcc/ChangeLog:
* config/riscv/riscv.cc (riscv_have_cond_zero): Implement
TARGET_HAVE_COND_ZERO
(TARGET_HAVE_COND_ZERO): define RISC-V hook
* doc/tm.texi: add TARGET_HAVE_COND_ZERO
* doc/tm.texi.in: add TARGET_HAVE_COND_ZERO
* target.def: define TARGET_HAVE_COND_ZERO
I'd like to avoid doing something like this. If we must query the
target for information, I think the better choice would be to construct
a conditional zero insn, then see if it's recognized. ie, why create a
new target hook when we can ask the question using existing mechanisms.
jeff