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

--- Comment #2 from ptomsich at gcc dot gnu.org ---
Agreed on the cost-model: we actually ran into this with an ungated version of
this transform regressed 731.astcenc_r. This is why we restricted to late
phiopt and to clusters feeding loop-carried reductions.

I still believe that this one falls between the layers and should be
acceptable:
- RTL if-conversion does not trigger: aarch64 at -O2, ce1/ce2/ce3 only perform
IF-CASE-2 block replacement here, and the final code keeps the fcmpe + b.gt.
The single-set variants of the same loop do become csel/fcsel.
- the GIMPLE-side motivation is narrower than "create COND_EXPRs": we target
_only_ the value PHI folding to MIN_EXPR/MAX_EXPR (and the index select remains
as a COND_EXPR).

If extending noce_convert_multiple_sets for that is the preferred fix, we are
happy to try an implementation there.

Would restricting the transform to minmax make it acceptable as an idiom
recognition? Or do you see RTL noce as the only acceptable place even for that
form?

Reply via email to