This is an archive of the discontinued LLVM Phabricator instance.

[BranchFolding] Propagate CSR live-ins to returning blocks. See D31188 for discussion.
AbandonedPublic

Authored by timshen on Apr 18 2017, 12:23 AM.

Details

Summary

This patch fixes pr32292 correctly. In order to see the patch really works on the test case, r299124 and r299125 need to be reverted to reveal the mis-compile. Tested with r299124 and r299125 reverted locally.

The getPristine usage seems still inaccurate, but we can fix that later.

Event Timeline

timshen created this revision.Apr 18 2017, 12:23 AM
This comment was removed by asl.
This comment was removed by asl.
This comment was removed by asl.
This comment was removed by asl.
timshen retitled this revision from [BranchFolding] Propagate CSR live-inss to returning blocks. See D31188 for discussion. to [BranchFolding] Propagate CSR live-ins to returning blocks. See D31188 for discussion..Apr 18 2017, 2:23 AM
asl added a subscriber: asl.Apr 18 2017, 2:47 AM
MatzeB requested changes to this revision.Apr 24 2017, 3:36 PM

Ok, I can reproduce and clearly see incorrect live-in information after ifconversion was running.

However the proposed fix makes no sense to me. computeLiveIns() should work fine even for a return block, I'll try to find out why it fails here.

This revision now requires changes to proceed.Apr 24 2017, 3:36 PM

I located the root cause of this problem being a bug in LivePhysRegs::addLiveOutsNoPristines(), this fixes it: https://reviews.llvm.org/D32464

timshen abandoned this revision.May 30 2017, 4:26 PM