aboutsummaryrefslogtreecommitdiff
path: root/gcc/expr.cc
diff options
context:
space:
mode:
authorAndrew Pinski <quic_apinski@quicinc.com>2024-07-25 17:07:28 -0700
committerAndrew Pinski <quic_apinski@quicinc.com>2024-07-26 09:52:38 -0700
commitdb74887097272a8390e33eba47c6fb8f50b64f5c (patch)
treecadc3b2905e83190b0f34d0166145b99b052f06a /gcc/expr.cc
parent9e7b2ad4abae69e6348220b7c5ad2fb8e3d52c83 (diff)
downloadgcc-db74887097272a8390e33eba47c6fb8f50b64f5c.zip
gcc-db74887097272a8390e33eba47c6fb8f50b64f5c.tar.gz
gcc-db74887097272a8390e33eba47c6fb8f50b64f5c.tar.bz2
isel: Small cleanup of duplicating comparisons
This is a small cleanup of the duplicating comparison code. There is code generation difference but only for -O0 and -fno-tree-ter (both of which will be fixed in a later patch). The difference is instead of skipping the first use if the comparison uses are only in cond_expr we skip the last use. Also we go through the uses list in the opposite order now too. The cleanups are the following: * Don't call has_single_use as we will do the loop anyways * Change the order of the checks slightly, it is better to check for cond_expr earlier * Use cond_exprs as a stack and pop from it. Skipping the top if the use is only from cond_expr. Bootstrapped and tested on x86_64-linux-gnu with no regressions. gcc/ChangeLog: * gimple-isel.cc (duplicate_comparison): Rename to ... (maybe_duplicate_comparison): This. Add check for use here rather than in its caller. (pass_gimple_isel::execute): Don't check how many uses the comparison had and call maybe_duplicate_comparison instead of duplicate_comparison. Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com>
Diffstat (limited to 'gcc/expr.cc')
0 files changed, 0 insertions, 0 deletions