This is an archive of the discontinued LLVM Phabricator instance.

AMDGPU/SI: Fix visit order assumption in SIFixSGPRCopies
ClosedPublic

Authored by tstellarAMD on Nov 4 2016, 11:03 AM.

Details

Summary

This pass was assuming that when a PHI instruction defined a register
used by another PHI instruction that the defining insstruction would
be legalized before the using instruction.

This assumption was causing the pass to not legalize some PHI nodes
within divergent flow-control.

This fixes a bug that was uncovered by r285762.

Diff Detail

Repository
rL LLVM

Event Timeline

tstellarAMD retitled this revision from to AMDGPU/SI: Fix visit order assumption in SIFixSGPRCopies.
tstellarAMD updated this object.
tstellarAMD added a reviewer: arsenm.
tstellarAMD added a subscriber: llvm-commits.
nhaehnle accepted this revision.Nov 7 2016, 3:26 AM
nhaehnle added a reviewer: nhaehnle.

LGTM, one minor comment.

test/CodeGen/AMDGPU/salu-to-valu.ll
460 ↗(On Diff #76923)

GCN-LABEL

This revision is now accepted and ready to land.Nov 7 2016, 3:26 AM
arsenm accepted this revision.Nov 7 2016, 8:32 AM
arsenm edited edge metadata.

LGTM with nits

lib/Target/AMDGPU/SIFixSGPRCopies.cpp
242 ↗(On Diff #76923)

Spaces around +=

253 ↗(On Diff #76923)

Ditto

262 ↗(On Diff #76923)

Space before (

263 ↗(On Diff #76923)

break on new line

This revision was automatically updated to reflect the committed changes.