aboutsummaryrefslogtreecommitdiff
path: root/gcc/expr.cc
diff options
context:
space:
mode:
authorHongyu Wang <hongyu.wang@intel.com>2024-06-13 00:18:32 +0800
committerHongyu Wang <hongyu.wang@intel.com>2024-06-13 22:04:08 +0800
commit83a765768510d1f329887116757d6818d7846717 (patch)
tree85884f9afdae7599d7c721ad8d27e7cae21a1944 /gcc/expr.cc
parent7fed7e9bbc57d502e141e079a6be2706bdbd4560 (diff)
downloadgcc-83a765768510d1f329887116757d6818d7846717.zip
gcc-83a765768510d1f329887116757d6818d7846717.tar.gz
gcc-83a765768510d1f329887116757d6818d7846717.tar.bz2
[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.
Diffstat (limited to 'gcc/expr.cc')
-rw-r--r--gcc/expr.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/expr.cc b/gcc/expr.cc
index 1baa39b..04bad5e 100644
--- a/gcc/expr.cc
+++ b/gcc/expr.cc
@@ -11089,7 +11089,7 @@ expand_expr_real_gassign (gassign *g, rtx target, machine_mode tmode,
ops.op1 = gimple_assign_rhs2 (g);
/* Try to expand conditonal compare. */
- if (targetm.gen_ccmp_first)
+ if (targetm.have_ccmp ())
{
gcc_checking_assert (targetm.gen_ccmp_next != NULL);
r = expand_ccmp_expr (g, TYPE_MODE (ops.type));