diff options
author | Robin Dapp <rdapp@linux.ibm.com> | 2019-11-27 13:53:40 +0100 |
---|---|---|
committer | Robin Dapp <rdapp@linux.ibm.com> | 2022-01-19 18:36:04 +0100 |
commit | e9ebb86799fd77cdd5351078230c114a90e66066 (patch) | |
tree | b4059397fb9dbe62eb1ae824af3b22f13c7ab400 /gcc/expr.cc | |
parent | 46346d8d76c24bd07a30cb2c367e34601efabfef (diff) | |
download | gcc-e9ebb86799fd77cdd5351078230c114a90e66066.zip gcc-e9ebb86799fd77cdd5351078230c114a90e66066.tar.gz gcc-e9ebb86799fd77cdd5351078230c114a90e66066.tar.bz2 |
ifcvt/optabs: Allow using a CC comparison for emit_conditional_move.
Currently we only ever call emit_conditional_move with the comparison
(as well as its comparands) we got from the jump. Thus, backends are
going to emit a CC comparison for every conditional move that is being
generated instead of re-using the existing CC.
This, combined with emitting temporaries for each conditional move,
causes sky-high costs for conditional moves.
This patch allows to re-use a CC so the costing situation is improved a
bit.
gcc/ChangeLog:
* rtl.h (struct rtx_comparison): New struct that holds an rtx
comparison.
* config/rs6000/rs6000.cc (rs6000_emit_minmax): Use struct instead of
single parameters.
(rs6000_emit_swsqrt): Likewise.
* expmed.cc (expand_sdiv_pow2): Likewise.
(emit_store_flag): Likewise.
* expr.cc (expand_cond_expr_using_cmove): Likewise.
(expand_expr_real_2): Likewise.
* ifcvt.cc (noce_emit_cmove): Add compare and reversed compare
parameters.
* optabs.cc (emit_conditional_move_1): New function.
(expand_doubleword_shift_condmove): Use struct.
(emit_conditional_move): Use struct and allow to call directly
without going through preparation steps.
* optabs.h (emit_conditional_move): Use struct.
Diffstat (limited to 'gcc/expr.cc')
-rw-r--r-- | gcc/expr.cc | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/gcc/expr.cc b/gcc/expr.cc index 4324b18..35e4029 100644 --- a/gcc/expr.cc +++ b/gcc/expr.cc @@ -8824,8 +8824,9 @@ expand_cond_expr_using_cmove (tree treeop0 ATTRIBUTE_UNUSED, op2 = gen_lowpart (mode, op2); /* Try to emit the conditional move. */ - insn = emit_conditional_move (temp, comparison_code, - op00, op01, comparison_mode, + insn = emit_conditional_move (temp, + { comparison_code, op00, op01, + comparison_mode }, op1, op2, mode, unsignedp); @@ -9716,8 +9717,9 @@ expand_expr_real_2 (sepops ops, rtx target, machine_mode tmode, start_sequence (); /* Try to emit the conditional move. */ - insn = emit_conditional_move (target, comparison_code, - op0, cmpop1, mode, + insn = emit_conditional_move (target, + { comparison_code, + op0, cmpop1, mode }, op0, op1, mode, unsignedp); |