This is an archive of the discontinued LLVM Phabricator instance.

[SimplifyCFG] Try to do somethink with misscompile bug in widenable condition.
Needs RevisionPublic

Authored by dbakunevich on Dec 14 2021, 9:00 PM.

Details

Reviewers
mkazantsev
Summary

When working with optimizations on widenable condition, a misscompile bug was found.
@mkazantsev tried to fix the bug by limiting one of the transforms, but this transforms is a weird, but a legal form of guard widening. He doesn't have strong enough ground to disable it.
So maybe the only way to break the infinite loop here is just to break while-loop after N iterations.
Link to Maxim's patch https://reviews.llvm.org/D112693

Diff Detail

Event Timeline

dbakunevich created this revision.Dec 14 2021, 9:00 PM
dbakunevich requested review of this revision.Dec 14 2021, 9:00 PM
Herald added a project: Restricted Project. · View Herald TranscriptDec 14 2021, 9:00 PM
lebedev.ri retitled this revision from Try to do somethink with misscompile bug in widenable condition. to [SimplifyCFG] Try to do somethink with misscompile bug in widenable condition..Dec 15 2021, 1:25 AM
lebedev.ri added a subscriber: lebedev.ri.

Semi-weak -1
Test?

Semi-weak -1
Test?

I updated this patch. Updated old test written by Max Kazantsev.
Need I wrote one more test for my patch?

mkazantsev requested changes to this revision.Dec 19 2021, 8:53 PM

Please rewrite commit message here to make it clear what's going on.

The point here is that I tried to fix the hang by limiting one of the transforms. But as it was pointed out on review, this transform is a weird, but legal form of guard widening. So I don't have strong enough ground to disable it.

On the other hand, there are 3 unrelated transforms described in D112693 that lead to infinite loop.

I can' say either of them is illegal, and there is no clear invariant set that one of them would break. So maybe the only way to break the infinite loop here is just to break while-loop after N interations.

This revision now requires changes to proceed.Dec 19 2021, 8:53 PM
dbakunevich edited the summary of this revision. (Show Details)Dec 20 2021, 12:55 AM

D112693 made it sound like the actual problem is in the front-end.