This is an archive of the discontinued LLVM Phabricator instance.

AMDGPU/SDAG: Custom SETCC (i.e. ballot) is always uniform
ClosedPublic

Authored by nhaehnle on Apr 8 2022, 6:50 PM.

Details

Summary

The AMDGPUISD::SETCC node is like ISD::SETCC, but returns a lane mask
instead of a per-lane boolean. The lane mask is uniform.

This improves instruction selection for code patterns like
ctpop(ballot(x)), which can now use an S_BCNT1_* instruction instead
of V_BCNT_*.

Diff Detail

Event Timeline

nhaehnle created this revision.Apr 8 2022, 6:50 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 8 2022, 6:50 PM
nhaehnle requested review of this revision.Apr 8 2022, 6:50 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 8 2022, 6:50 PM
Herald added a subscriber: wdng. · View Herald Transcript

GlobalISel already selects scalar instructions. I added tests for SelectionDAG and GlobalISel in the same commit earlier.

arsenm accepted this revision.Apr 9 2022, 7:19 AM
This revision is now accepted and ready to land.Apr 9 2022, 7:19 AM
This revision was landed with ongoing or failed builds.Apr 11 2022, 12:04 PM
This revision was automatically updated to reflect the committed changes.