]> git.ipfire.org Git - thirdparty/gcc.git/commit
[APX CCMP] Add targetm.have_ccmp hook [PR115370]
authorHongyu Wang <hongyu.wang@intel.com>
Wed, 12 Jun 2024 16:18:32 +0000 (00:18 +0800)
committerHongyu Wang <hongyu.wang@intel.com>
Thu, 13 Jun 2024 14:04:08 +0000 (22:04 +0800)
commit83a765768510d1f329887116757d6818d7846717
tree85884f9afdae7599d7c721ad8d27e7cae21a1944
parent7fed7e9bbc57d502e141e079a6be2706bdbd4560
[APX CCMP] Add targetm.have_ccmp hook [PR115370]

In cfgexpand, there is an optimization for branch which tests
targetm.gen_ccmp_first == NULL. However for target like x86-64, the
hook was implemented but it does not indicate that ccmp was enabled.
Add a new target hook TARGET_HAVE_CCMP and replace the middle-end
check for the existance of gen_ccmp_first to avoid misoptimization.

gcc/ChangeLog:

PR target/115370
PR target/115463
* target.def (have_ccmp): New target hook.
* targhooks.cc (default_have_ccmp): New function.
* targhooks.h (default_have_ccmp): New prototype.
* doc/tm.texi.in: Add TARGET_HAVE_CCMP.
* doc/tm.texi: Regenerate.
* cfgexpand.cc (expand_gimple_cond): Call targetm.have_ccmp
instead of checking if targetm.gen_ccmp_first exists.
* expr.cc (expand_expr_real_gassign): Likewise.
* config/i386/i386.cc (ix86_have_ccmp): New target hook to
check if APX_CCMP enabled.
(TARGET_HAVE_CCMP): Define.
gcc/cfgexpand.cc
gcc/config/i386/i386.cc
gcc/doc/tm.texi
gcc/doc/tm.texi.in
gcc/expr.cc
gcc/target.def
gcc/targhooks.cc
gcc/targhooks.h