This is an archive of the discontinued LLVM Phabricator instance.

AMDGPU: Remove SIFixSGPRLiveRanges pass
ClosedPublic

Authored by nhaehnle on Apr 12 2016, 4:35 PM.

Details

Summary

This pass is unnecessary and overly conservative. It was motivated by
situations like

def %vreg0:SGPR_32
...

if-block:

..
def %vreg1:SGPR_32
...

else-block:

...
use %vreg0:SGPR_32
...

and similar situations with uses after the non-uniform control flow, where
we are not allowed to assign %vreg0 and %vreg1 to the same physical register,
even though in the original, thread/workitem-based CFG, it looks like the
live ranges of these registers do not overlap.

However, by the time register allocation runs, we have moved to a wave-based
CFG that accurately represents the fact that the wave may run through both
the if- and the else-block. So the live ranges of %vreg0 and %vreg1 already
overlap even without the SIFixSGPRLiveRanges pass.

In addition to proving this change correct, I have tested it with Piglit
and a small number of other tests.

Diff Detail

Repository
rL LLVM

Event Timeline

nhaehnle updated this revision to Diff 53492.Apr 12 2016, 4:35 PM
nhaehnle retitled this revision from to AMDGPU: Remove SIFixSGPRLiveRanges pass.
nhaehnle updated this object.
nhaehnle added reviewers: arsenm, tstellarAMD.
nhaehnle added a subscriber: llvm-commits.
tstellarAMD accepted this revision.Apr 13 2016, 3:33 PM
tstellarAMD edited edge metadata.

LGTM.

This revision is now accepted and ready to land.Apr 13 2016, 3:33 PM
This revision was automatically updated to reflect the committed changes.
llvm/trunk/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp