This is an archive of the discontinued LLVM Phabricator instance.

AMDGPU: Fix folding immediate into readfirstlane through reg_sequence
ClosedPublic

Authored by arsenm on Jun 19 2019, 10:17 AM.

Details

Reviewers
rampitec
nhaehnle
Summary

The def instruction for the vreg may not match, because it may be
folding through a reg_sequence. t's not actually important if DefMI really defined the
register, because the fold that will be done cares about the def of
the value that will be folded.

For some reason copies aren't making it through the reg_sequence,
although they should.

Diff Detail

Event Timeline

arsenm created this revision.Jun 19 2019, 10:17 AM
arsenm marked an inline comment as done.Jun 19 2019, 10:21 AM
arsenm added inline comments.
lib/Target/AMDGPU/SIInstrInfo.cpp
6083–6085

Actually it would probably be more correct to delete the assert. We care about the original value def point that we're going to fold, not the actual def instruction

arsenm updated this revision to Diff 205634.Jun 19 2019, 10:23 AM

Just delete assert instead

arsenm edited the summary of this revision. (Show Details)Jun 19 2019, 10:25 AM
rampitec added inline comments.Jun 19 2019, 11:26 AM
lib/Target/AMDGPU/SIFoldOperands.cpp
443

Next = std::next(RSUse)?

arsenm updated this revision to Diff 205654.Jun 19 2019, 11:45 AM

std::next

This revision is now accepted and ready to land.Jun 19 2019, 1:34 PM
arsenm closed this revision.Jun 19 2019, 1:40 PM

r363876