https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97734

Alexander Monakov <amonakov at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |amonakov at gcc dot gnu.org

--- Comment #2 from Alexander Monakov <amonakov at gcc dot gnu.org> ---
By the time RTL ce2 pass runs the RTL is suitable for if-conversion, but the
pass rejects the transform (probably due to costs, not visible in dumps so
impossible to tell without gdb'ing the compiler).

Note that this cmov lengthens the loop-carried data dependency on 'i', so it's
only beneficial on workloads where the control dependency it replaces
corresponds to an unpredictable branch. And GCC has no way to know that.

For a recent counter-example (cmov dramatically slowing down a loop with a
trivially predictable branch) please see
https://stackoverflow.com/a/64285902/4755075

At risk of needlessly repeating myself: I think what people doing such research
really need is __builtin_branchless_select that is properly guaranteed to be
branchless (selection statement on GIMPLE and branchless sequence on RTL).
Otherwise they spend time tweaking their code to make cmov appear where they
need it.

Reply via email to