This is an archive of the discontinued LLVM Phabricator instance.

AMDGPU/GlobalISel: Introduce vcc reg bank
ClosedPublic

Authored by arsenm on Dec 17 2018, 2:27 AM.

Details

Reviewers
tstellar
Summary

I'm not entirely sure this is the correct thing
to do with the global isel philosophy, but I think
this is necessary to handle how differently SGPRs
are used normally vs. from a condition.

For example, it makes sense to allow a copy
from a VGPR to an SGPR, but it makes no sense
to allow a copy from VGPRs to SGPRs used as
select mask.

This avoids regbankselecting strange code with
a truncate feeding directly into a condition field.
Now a copy is forced from sgpr(s1) to vcc, which is
more sensible to handle.

Some of these issues could probably avoided with making enough
operations resulting in i1 illegal. I think we can't avoid
this register bank for legality.

For example, an i1 and where one source is from a truncate, and
one source is a compare needs some kind of copy inserted to
make sure both are in condition registers.

Diff Detail

Event Timeline

arsenm created this revision.Dec 17 2018, 2:27 AM
arsenm updated this revision to Diff 178841.Dec 19 2018, 12:28 AM
arsenm edited the summary of this revision. (Show Details)

Rebase and include some examples that I think show this is needed

tstellar accepted this revision.Dec 19 2018, 1:50 PM

LGTM.

This revision is now accepted and ready to land.Dec 19 2018, 1:50 PM
arsenm closed this revision.Jan 7 2019, 10:34 PM

r350611