This is an archive of the discontinued LLVM Phabricator instance.

RenameIndependentSubregs: Fix handling of undef tied operands
ClosedPublic

Authored by arsenm on Jun 5 2017, 3:22 PM.

Details

Reviewers
MatzeB
Summary

If a tied source operand was undef, it would be replaced but not
update the other tied operand, which would end up using different
virtual registers.

Diff Detail

Event Timeline

arsenm created this revision.Jun 5 2017, 3:22 PM
MatzeB accepted this revision.Jun 5 2017, 3:26 PM

Good catch, LGTM.

lib/CodeGen/RenameIndependentSubregs.cpp
246–247

Could you add a comment along the lines of `
/// Undef use operands are not tracked in the equivalence class but need to be update if they are tied.

test/CodeGen/AMDGPU/rename-independent-subregs-invalid-mac-operands.mir
2–23

Do you actually need the IR, see also: http://llvm.org/docs/MIRLangRef.html#simplifying-mir-files

This revision is now accepted and ready to land.Jun 5 2017, 3:26 PM
arsenm added inline comments.Jun 5 2017, 3:37 PM
test/CodeGen/AMDGPU/rename-independent-subregs-invalid-mac-operands.mir
2–23

It complains if I try to remove it entirely. It seems to want the blocks at least

MatzeB added inline comments.Jun 5 2017, 3:46 PM
test/CodeGen/AMDGPU/rename-independent-subregs-invalid-mac-operands.mir
2–23

You have to use the bb.0 instead of bb.0.bb etc. (the .bb at the end is a reference to the IR block).

arsenm closed this revision.Jun 5 2017, 3:59 PM
arsenm marked 4 inline comments as done.

r304747