aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-iterator.cc
diff options
context:
space:
mode:
authorMichael Collison <collison@rivosinc.com>2022-12-02 08:40:05 +0100
committerRichard Biener <rguenther@suse.de>2022-12-02 09:22:01 +0100
commit6508d5e5a1a8c08bebf83d258fad525eadc9f5d1 (patch)
tree8799cc2dad553ed6c4f19a588ee205a416844239 /gcc/tree-iterator.cc
parent5b50850c3c6f2eceb8012dcc8d3cd5ddd94fac6c (diff)
downloadgcc-6508d5e5a1a8c08bebf83d258fad525eadc9f5d1.zip
gcc-6508d5e5a1a8c08bebf83d258fad525eadc9f5d1.tar.gz
gcc-6508d5e5a1a8c08bebf83d258fad525eadc9f5d1.tar.bz2
match.pd: rewrite select to branchless expression
This patches transforms ((x & 0x1) == 0) ? y : z <op> y -into (-(typeof(y))(x & 0x1) & z) <op> y, where op is a '^' or a '|'. It also transforms (cond (and (x , 0x1) != 0), (z op y), y ) into (-(and (x , 0x1)) & z ) op y. Matching this patterns allows GCC to generate branchless code for one of the functions in coremark. * match.pd ((x & 0x1) == 0) ? y : z <op> y -> (-(typeof(y))(x & 0x1) & z) <op> y. * gcc.dg/tree-ssa/branchless-cond.c: New test.
Diffstat (limited to 'gcc/tree-iterator.cc')
0 files changed, 0 insertions, 0 deletions