This is an archive of the discontinued LLVM Phabricator instance.

AMDGPU/GlobalISel: Manually RegBankSelect copies
ClosedPublic

Authored by arsenm on Feb 20 2020, 11:24 AM.

Details

Summary

This was failng on any pre-assigned copy to the VCC bank.

This is something of a workaround for the default implementation in
getInstrMappingImpl, and how it treats copy-like operations in
general.

Copy-like operations are considered to only have one result register
bank, rather than separate banks for each source like a normal
instruction. To avoid potentially mishandling reg_sequence with
impossible operand combinations, the generic implementation errors on
impossible costs. If the bank was already assigned, is treated it
as-if it were an unsatisfiable REG_SEQUENCE mapping. We really don't
get any value from any of what getInstrMappingImpl tries to do for
copies, so just directly emit the simple mapping we really want.

Diff Detail

Event Timeline

arsenm created this revision.Feb 20 2020, 11:24 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 20 2020, 11:24 AM
qcolombet accepted this revision.Mar 10 2020, 9:13 PM
qcolombet added inline comments.
llvm/lib/Target/AMDGPU/AMDGPURegisterBankInfo.cpp
2993

You should be able to assert on this, like you suspected in your comment.

We use RPO, so sources should have been assigned at this point.

This revision is now accepted and ready to land.Mar 10 2020, 9:13 PM