This is an archive of the discontinued LLVM Phabricator instance.

[RegAlloc] CalcSpillWeights: Fix infinite loop
AbandonedPublic

Authored by timshen on Feb 10 2016, 11:32 AM.

Details

Reviewers
qcolombet
Summary

isRematerializable() doesn't have to check the same VNInfo for twice, since it doesn't mutate anything. With this it can handle circles.

There is no functional change.

Diff Detail

Event Timeline

timshen updated this revision to Diff 47495.Feb 10 2016, 11:32 AM
timshen retitled this revision from to CalcSpillWeights: Fix infinite loop.
timshen updated this object.
timshen retitled this revision from CalcSpillWeights: Fix infinite loop to [RegAlloc] CalcSpillWeights: Fix infinite loop.Feb 10 2016, 11:38 AM

Hmmm...not sure why llvm-commits is not publishing this. Test test.

qcolombet edited edge metadata.Feb 10 2016, 1:54 PM

Hi Tim,

Do you actually have a test case for that?

Since we bail out on PHIs, I do not see how you can have a loop here.

Cheers,
-Quentin

timshen updated this revision to Diff 47550.Feb 10 2016, 3:17 PM
timshen edited edge metadata.

Attached reduced test case.

Sorry, I also found that this change is wrong. I thought it works but I forgot to turn on assertion. This test case triggers an assertion failure with this change. I will do more investigation.

Thanks for the update.

If you need help narrowing that down, please file a PR with the symptoms and how to reproduce.

Cheers,
Q.

timshen abandoned this revision.Feb 29 2016, 2:32 PM

Never mind, I turned on -verify-machineinstrs and it shows a bug in a previous pass.