aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/constexpr.c
diff options
context:
space:
mode:
authorMarc Glisse <marc.glisse@inria.fr>2020-08-05 16:45:33 +0200
committerGiuliano Belinassi <giuliano.belinassi@usp.br>2020-08-17 15:07:40 -0300
commite39bab3091ff4641e935f7a565cbafd25a299ad1 (patch)
tree0441485fdcc30c2889d37d365d6e868cde4179fb /gcc/cp/constexpr.c
parent6316834ed9731a385236b9ebdcc8057aeb40b508 (diff)
downloadgcc-e39bab3091ff4641e935f7a565cbafd25a299ad1.zip
gcc-e39bab3091ff4641e935f7a565cbafd25a299ad1.tar.gz
gcc-e39bab3091ff4641e935f7a565cbafd25a299ad1.tar.bz2
VEC_COND_EXPR optimizations
When vector comparisons were forced to use vec_cond_expr, we lost a number of optimizations (my fault for not adding enough testcases to prevent that). This patch tries to unwrap vec_cond_expr a bit so some optimizations can still happen. I wasn't planning to add all those transformations together, but adding one caused a regression, whose fix introduced a second regression, etc. Restricting to constant folding would not be sufficient, we also need at least things like X|0 or X&X. The transformations are quite conservative with :s and folding only if everything simplifies, we may want to relax this later. And of course we are going to miss things like a?b:c + a?c:b -> b+c. In terms of number of operations, some transformations turning 2 VEC_COND_EXPR into VEC_COND_EXPR + BIT_IOR_EXPR + BIT_NOT_EXPR might not look like a gain... I expect the bit_not disappears in most cases, and VEC_COND_EXPR looks more costly than a simpler BIT_IOR_EXPR. 2020-08-05 Marc Glisse <marc.glisse@inria.fr> PR tree-optimization/95906 PR target/70314 * match.pd ((c ? a : b) op d, (c ? a : b) op (c ? d : e), (v ? w : 0) ? a : b, c1 ? c2 ? a : b : b): New transformations. (op (c ? a : b)): Update to match the new transformations. * gcc.dg/tree-ssa/andnot-2.c: New file. * gcc.dg/tree-ssa/pr95906.c: Likewise. * gcc.target/i386/pr70314.c: Likewise.
Diffstat (limited to 'gcc/cp/constexpr.c')
0 files changed, 0 insertions, 0 deletions