This is an archive of the discontinued LLVM Phabricator instance.

AMDGPU: Add implicit def of SCC to kill and indirect pseudos
ClosedPublic

Authored by nhaehnle on Jun 5 2018, 12:12 AM.

Details

Summary

Kill instructions sometimes do use SCC in unusual circumstances, when
v_cmpx cannot be used due to the operands that are involved.

Additionally, even if SCC was never defined by the expansion, kill pseudos
could previously occur between an s_cmp and an s_cbranch_scc, which breaks
the SCC liveness tracking when the pseudo is expanded to split the basic
block. While it would be possible to explicitly mark the SCC as live-in for
the successor basic block, it's simpler to just mark the pseudo as using SCC,
so that such a sequence is never emitted by instruction selection in the
first place.

A similar issue affects indirect source/dest pseudos in principle, although
I haven't been able to come up with a test case where it actually matters
(this affects instruction selection, so a MIR test can't be used).

Fixes: dEQP-GLES3.functional.shaders.discard.dynamic_loop_always
Change-Id: Ica8d82ecff1a763b892a1112cf1b06c948863a4f

Diff Detail

Repository
rL LLVM

Event Timeline

nhaehnle created this revision.Jun 5 2018, 12:12 AM
nhaehnle retitled this revision from AMDGPU: Add implicit use of SCC to kill and indirect pseudos to AMDGPU: Add implicit def of SCC to kill and indirect pseudos.Jun 5 2018, 12:16 AM
arsenm accepted this revision.Jun 5 2018, 12:55 AM

LGTM

This revision is now accepted and ready to land.Jun 5 2018, 12:55 AM
rampitec accepted this revision.Jun 5 2018, 9:06 AM

LGTM

This revision was automatically updated to reflect the committed changes.