This is an archive of the discontinued LLVM Phabricator instance.

Fix regalloc-verifier error for r265547
ClosedPublic

Authored by wmi on Apr 9 2016, 11:02 AM.

Details

Reviewers
qcolombet
Summary

This is to fix the problem here:
http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20160404/345537.html

The error is caused by that I didn't create live interval for the dummy register used in rematerialization. regalloc-verifier requires any vreg has a live interval, and because it is a dummy register without live range segment, verifier requires it to be marked as Dead.

However, rematerialization may copy the dead flag to the instruction cloned, which is incorrect. So I need to set the Dead flag to false before doing rematerialization and reset it to true after that.

Diff Detail

Repository
rL LLVM

Event Timeline

wmi updated this revision to Diff 53139.Apr 9 2016, 11:02 AM
wmi retitled this revision from to Fix regalloc-verifier error for r265547.
wmi updated this object.
wmi added a reviewer: qcolombet.
wmi set the repository for this revision to rL LLVM.
wmi added subscribers: llvm-commits, davidxl.
qcolombet added inline comments.Apr 11 2016, 1:51 PM
lib/CodeGen/LiveRangeEdit.cpp
153

This code feels so wrong.
I am okay if we would have to reset isDead to false for DestReg, since the remat may just clone the input, but we shouldn’t have to do a gymnastic with OrigMI.

wmi added inline comments.Apr 11 2016, 2:36 PM
lib/CodeGen/LiveRangeEdit.cpp
153

Yes, you are right. It is better to just reset isDead to false for DestReg of the instruction cloned by remat.

wmi updated this revision to Diff 53321.Apr 11 2016, 2:37 PM

Address Quentins' comment.

wmi added a comment.Apr 12 2016, 2:47 PM

Hi Quentin,

Do you think the change looks ok now? I did another round of testing for the original patch plus all the updated bug fixing patches and saw no failure. If it is ok, I will recommit all these changes again.

Thanks,
Wei.

qcolombet accepted this revision.Apr 12 2016, 3:28 PM
qcolombet edited edge metadata.

LGTM.

This revision is now accepted and ready to land.Apr 12 2016, 3:28 PM
Eugene.Zelenko added a subscriber: Eugene.Zelenko.

Settled in r266162.