This is an archive of the discontinued LLVM Phabricator instance.

AMDGPU: Expand register indexing pseudos in custom inserter
ClosedPublic

Authored by arsenm on Jul 5 2016, 5:15 PM.

Details

Reviewers
tstellarAMD
Summary

This is to help moveSILowerControlFlow to before regalloc.
There are a couple of tradeoffs with this. The complete CFG
is visible to more passes, the loop body avoids an extra copy of m0,
vcc isn't required, and immediate offsets can be shrunk into s_movk_i32.

The disadvantage is the register allocator doesn't understand that
the single lane's vector is dead within the loop body, so an extra
register is used to outlive the loop block when expanding the
VGPR -> m0 loop. This also now results in worse waitcnt insertion
before the loop instead of after for pending operations at the point
of the indexing, but that should be fixed by future improvements to
cross block waitcnt insertion.

v_movreld_b32's operands are now modeled more correctly since vdst
is not a true output. This is kind of a hack to treat vdst as a
use operand. Extra checking is required in the verifier since
I can't seem to get tablegen to emit an implicit operand for a
virtual register.

Diff Detail

Event Timeline

arsenm updated this revision to Diff 62805.Jul 5 2016, 5:15 PM
arsenm retitled this revision from to AMDGPU: Expand register indexing pseudos in custom inserter.
arsenm updated this object.
arsenm added a reviewer: tstellarAMD.
arsenm added a subscriber: llvm-commits.
tstellarAMD accepted this revision.Jul 8 2016, 5:58 PM
tstellarAMD edited edge metadata.

LGTM.

This revision is now accepted and ready to land.Jul 8 2016, 5:58 PM
arsenm updated this revision to Diff 63779.Jul 12 2016, 10:39 PM
arsenm edited edge metadata.

Fix disassembler tests

arsenm closed this revision.Jul 18 2016, 5:42 PM

r275934

test/CodeGen/AMDGPU/indirect-addressing-si.ll