This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU] Changing S_AND_B32 to V_AND_B32_e64 in the divergent 'trunc' to i1 pattern
ClosedPublic

Authored by alex-t on Dec 23 2021, 2:05 PM.

Details

Summary

In 'trunc' i16/32/64 to i1 pattern the 'and $src, 1' node supply operand to 'setcc'.
The latter is selected to S_CMP_EQ/V_CMP_EQ dependent on the divergence. In case the 'and' is scalar
and 'setcc' is divergent, we need VGPR to SGPR copy to adjust input operand for V_CMP_EQ.
This patch changes the S_AND_B32 to V_AND_B32_e64 in the 'trunc to i1' divergent patterns.

Diff Detail

Event Timeline

alex-t created this revision.Dec 23 2021, 2:05 PM
alex-t requested review of this revision.Dec 23 2021, 2:05 PM
Herald added a project: Restricted Project. · View Herald TranscriptDec 23 2021, 2:05 PM
Herald added a subscriber: wdng. · View Herald Transcript
alex-t updated this revision to Diff 396090.Dec 23 2021, 2:08 PM

test attributes corrected

This revision is now accepted and ready to land.Dec 23 2021, 3:18 PM
This revision was landed with ongoing or failed builds.Dec 24 2021, 7:22 AM
This revision was automatically updated to reflect the committed changes.