[Bug target/82666] [11/12/13/14 regression]: sum += (x>128 ? x : 0) puts the cmov on the critical path (at -O2)
law at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Fri Aug 4 04:18:53 GMT 2023
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82666
Jeffrey A. Law <law at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |law at gcc dot gnu.org
--- Comment #14 from Jeffrey A. Law <law at gcc dot gnu.org> ---
A better approach might be to to try and create COND_EXPRs for the conditional
move in the gimple code. The biggest problem I see with that is the
gimple->rtl converters aren't great at creating efficient code on targets
without conditional moves.
Meaning that we could well end up improving x86, but making several other
targets worse.
I know this because I was recently poking at a similar problem. We expressed a
conditional move of 0, C as a multiply of a boolean by C in gimple. It really
should just have been a COND_EXPR, but when we generate that form targets
without good conditional move expanders will end up recreating branchy code :(
More information about the Gcc-bugs
mailing list