This is an archive of the discontinued LLVM Phabricator instance.

AMDGPU: Limit the search in finding the instruction pattern for v_swap generation.
ClosedPublic

Authored by cfang on Feb 6 2020, 4:18 PM.

Details

Summary

Current implementation of matchSwap in SIShrinkInstructions searches the entire use_nodbg_operands set to find the possible
pattern to generate v_swap instruction. This approach will lead to a O(N^3) in compile time for SIShrinkInstructions.

But in reality, the matching pattern only exists within nearby instructions in the same basic block. This work limits the search to a maximum of
16 instructions, and has a linear compile time comsumption.

Diff Detail

Event Timeline

cfang created this revision.Feb 6 2020, 4:18 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 6 2020, 4:18 PM
rampitec accepted this revision.Feb 6 2020, 4:32 PM

LGTM

This revision is now accepted and ready to land.Feb 6 2020, 4:32 PM
This revision was automatically updated to reflect the committed changes.

I have reverted it. It has resulted in 96 lit test failures. Please run make check before posting review.

rampitec reopened this revision.Feb 6 2020, 5:57 PM
This revision is now accepted and ready to land.Feb 6 2020, 5:57 PM
rampitec requested changes to this revision.Feb 6 2020, 5:57 PM

Please make sure it passes llvm check tests.

This revision now requires changes to proceed.Feb 6 2020, 5:57 PM
cfang added a comment.Feb 6 2020, 7:53 PM

Where are these failing LIT tests located? I did LIT tests before posting for review and also before integrating.
Maybe my check is incomplete. Thanks.

Where are these failing LIT tests located? I did LIT tests before posting for review and also before integrating.
Maybe my check is incomplete. Thanks.

This is our main codegen tests. Didn't you check a release build?

cfang updated this revision to Diff 243238.Feb 7 2020, 10:51 AM

Fix the LIT test failures.
(Yes, I messed up with a release build check, Thanks for catching these).

rampitec accepted this revision.Feb 7 2020, 10:55 AM
This revision is now accepted and ready to land.Feb 7 2020, 10:55 AM
This revision was automatically updated to reflect the committed changes.