aboutsummaryrefslogtreecommitdiff
path: root/gcc/analyzer/analyzer-language.cc
diff options
context:
space:
mode:
authorAndrew Pinski <apinski@marvell.com>2023-06-13 09:17:45 -0700
committerAndrew Pinski <apinski@marvell.com>2023-08-02 01:07:24 -0700
commit7ff1d1b156cc78034e299757629de33e110a30b1 (patch)
tree92a9d9106f2e86f579ac576aad6daeb63244df91 /gcc/analyzer/analyzer-language.cc
parent21c2815605fb0ec43ea65b1104990cf03248013e (diff)
downloadgcc-7ff1d1b156cc78034e299757629de33e110a30b1.zip
gcc-7ff1d1b156cc78034e299757629de33e110a30b1.tar.gz
gcc-7ff1d1b156cc78034e299757629de33e110a30b1.tar.bz2
PHIOPT: Mark the conditional lhs and rhs as to look at to see if DCEable
In some cases (usually dealing with bools only), there could be some statements left behind which are considered trivial dead. An example is: ``` bool f(bool a, bool b) { if (!a && !b) return 0; if (!a && b) return 0; if (a && !b) return 0; return 1; } ``` Where during phiopt2, the IR had: ``` _3 = ~b_7(D); _4 = _3 & a_6(D); _4 != 0 ? 0 : 1 ``` match-and-simplify would transform that into: ``` _11 = ~a_6(D); _12 = b_7(D) | _11; ``` But phiopt would leave around the statements defining _4 and _3. This helps by marking the conditional's lhs and rhs to see if they are trivial dead. OK? Bootstrapped and tested on x86_64-linux-gnu. gcc/ChangeLog: * tree-ssa-phiopt.cc (match_simplify_replacement): Mark's cond statement's lhs and rhs to check if trivial dead. Rename inserted_exprs to exprs_maybe_dce; also move it so bitmap is not allocated if not needed.
Diffstat (limited to 'gcc/analyzer/analyzer-language.cc')
0 files changed, 0 insertions, 0 deletions