This is an archive of the discontinued LLVM Phabricator instance.

[IndVars] Set Changed if sinkUnusedInvariants changes IR. PR38863
ClosedPublic

Authored by mkazantsev on Sep 7 2018, 4:23 AM.

Details

Summary

Currently, sinkUnusedInvariants does not set Changed flag even if it makes
changes in the IR. There is no clear evidence that it can cause a crash, but it
looks highly suspicious and likely invalid.

Diff Detail

Repository
rL LLVM

Event Timeline

mkazantsev created this revision.Sep 7 2018, 4:23 AM

I see that IndVarsSimplify uses class field Changed. You propose to use Changed as return value. I just want to see the same approach through the whole IndVars...

Do you plan to modify other pieces to return Changed or may be it makes sense to re-use the class field approach here as well?
What do you think?

I see that IndVarsSimplify uses class field Changed. You propose to use Changed as return value. I just want to see the same approach through the whole IndVars...

Do you plan to modify other pieces to return Changed or may be it makes sense to re-use the class field approach here as well?
What do you think?

I agree that having Changed as a field is bizzare. It makes a lot of confusion regarding the proper place where it should be set. I plan to rework it to make it a local variable, but I haven't look into how easy it's gonna be.

skatkov accepted this revision.Sep 9 2018, 10:14 PM
This revision is now accepted and ready to land.Sep 9 2018, 10:14 PM
This revision was automatically updated to reflect the committed changes.