This is an archive of the discontinued LLVM Phabricator instance.

AMDGPU: Default to using scalar mov to materialize immediate
ClosedPublic

Authored by arsenm on Sep 9 2016, 11:55 AM.

Details

Reviewers
tstellarAMD
Summary

This is the conservatively correct way because it's easy to
move or replace a scalar immediate. This was incorrect in the case
when the register class wasn't known from the static instruction
definition, but still needed to be an SGPR. The main example of this
is inlineasm has an SGPR constraint.

Also start verifying the register classes of inlineasm operands.

Diff Detail

Event Timeline

arsenm updated this revision to Diff 70881.Sep 9 2016, 11:55 AM
arsenm retitled this revision from to AMDGPU: Default to using scalar mov to materialize immediate.
arsenm updated this object.
arsenm added a reviewer: tstellarAMD.
arsenm added a subscriber: llvm-commits.
tstellarAMD accepted this revision.Sep 9 2016, 4:36 PM
tstellarAMD edited edge metadata.

LGTM. This patch: https://reviews.llvm.org/D23417 plus on other I have should prevent a lot of these s_mov_b32 instructions from being moved to the valu.

This revision is now accepted and ready to land.Sep 9 2016, 4:36 PM

Looks like patch was not committed.

arsenm closed this revision.Nov 1 2016, 4:05 PM

r285762