This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU] Re-enabling divergence predicates for min/max
ClosedPublic

Authored by alex-t on Dec 17 2021, 10:40 AM.

Details

Summary

This patch enables divergence predicates for min/max nodes.
It makes ISD::MIN/MAX selected to S_MIN_I(U)32/S_MAX_I(U)32 or V_MIN_I(U)32_e64/V_MAX_I(U)32_e64

Diff Detail

Event Timeline

alex-t created this revision.Dec 17 2021, 10:40 AM
alex-t requested review of this revision.Dec 17 2021, 10:40 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 17 2021, 10:40 AM
Herald added a subscriber: wdng. · View Herald Transcript
alex-t edited the summary of this revision. (Show Details)Dec 17 2021, 10:41 AM
This revision is now accepted and ready to land.Dec 17 2021, 10:56 AM
This revision was landed with ongoing or failed builds.Dec 20 2021, 5:08 AM
This revision was automatically updated to reflect the committed changes.
foad added a comment.Dec 20 2021, 7:43 AM

Do you also need to use DivergentBinFrag on the definition of V_MIN_I32 (etc)?

defm V_MIN_I32 : VOP2Inst <"v_min_i32", VOP_PAT_GEN<VOP_I32_I32_I32>, smin>;

If you don't do that, for a uniform smin, the instruction selector could choose either S_MIN or V_MIN. Does it know that it should prefer S_MIN? How?