This is an archive of the discontinued LLVM Phabricator instance.

AMDGPU/GlobalISel: Fix constant bus violation with source modifiers
ClosedPublic

Authored by arsenm on Feb 20 2020, 12:39 PM.

Details

Summary

This looked through copies to find the source modifiers, which may
have been SGPR->VGPR copies added to avoid potential constant bus
violations. Re-insert a copy to a VGPR if this happens.

Diff Detail

Event Timeline

arsenm created this revision.Feb 20 2020, 12:39 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 20 2020, 12:39 PM
nhaehnle accepted this revision.Feb 21 2020, 4:08 AM

LGTM, modulo a question.

llvm/test/CodeGen/AMDGPU/GlobalISel/inst-select-fadd.s32.mir
168–169

The COPY isn't needed in this case. Which pass is responsible for cleaning that up again, and how do you envision that working in the long term? Is that a GICombine thing?

This revision is now accepted and ready to land.Feb 21 2020, 4:08 AM
arsenm marked an inline comment as done.Feb 21 2020, 7:29 AM
arsenm added inline comments.
llvm/test/CodeGen/AMDGPU/GlobalISel/inst-select-fadd.s32.mir
168–169

SIFoldOperands, or a rewrite of it should take care of this. Right now it's too stupid to handle folding multiple operands at a time, so it does a poor job cleaning it up. In the DAG we start out with incorrect MIR and fix it, so we have more SGPR operands to begin with