aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/tree.cc
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2023-04-20 19:44:27 +0200
committerJakub Jelinek <jakub@redhat.com>2023-04-20 19:44:27 +0200
commit87c9bae4e32b54829dce0a93ff735412d5f684f8 (patch)
tree5a8469b8623f17a132801ec6c336f03ddbe7a959 /gcc/cp/tree.cc
parent3d7ab53d6c59499624aa41c8dea0664976820b3b (diff)
downloadgcc-87c9bae4e32b54829dce0a93ff735412d5f684f8.zip
gcc-87c9bae4e32b54829dce0a93ff735412d5f684f8.tar.gz
gcc-87c9bae4e32b54829dce0a93ff735412d5f684f8.tar.bz2
tree-vect-patterns: One small vect_recog_ctz_ffs_pattern tweak [PR109011]
I've noticed I've made a typo, ifn in this function this late is always only IFN_CTZ or IFN_FFS, never IFN_CLZ. Due to this typo, we weren't using the originally intended .CTZ (X) = .POPCOUNT ((X - 1) & ~X) but .CTZ (X) = PREC - .POPCOUNT (X | -X) instead when we want to emit __builtin_ctz*/.CTZ using .POPCOUNT. Both compute the same value, both are defined at 0 with the same value (PREC), both have same number of GIMPLE statements, but I think the former ought to be preferred, because lots of targets have andn as a single operation rather than two, and also putting a -1 constant into a vector register is often cheaper than vector with broadcast PREC power of two value. 2023-04-20 Jakub Jelinek <jakub@redhat.com> PR tree-optimization/109011 * tree-vect-patterns.cc (vect_recog_ctz_ffs_pattern): Use .CTZ (X) = .POPCOUNT ((X - 1) & ~X) in preference to .CTZ (X) = PREC - .POPCOUNT (X | -X).
Diffstat (limited to 'gcc/cp/tree.cc')
0 files changed, 0 insertions, 0 deletions