This is an archive of the discontinued LLVM Phabricator instance.

[IfConversion] Make the ifcvt-limit command line option work at the function level and remove compares with global Statistic variables
AbandonedPublic

Authored by craig.topper on May 17 2017, 6:50 PM.

Details

Summary

Currently this limit is compared against the sum of the global Statistic variables. This means the limit is cumulative across all functions and all runs of the pass. This doesn't seem an intuitive way to implement this.

Another issue is that the command line option won't work in release builds because the Statistic objects will always return 0.

This is part of a larger plan to try to make it harder to misuse the Statistic objects.

Diff Detail

Event Timeline

craig.topper created this revision.May 17 2017, 6:50 PM
chandlerc edited edge metadata.May 17 2017, 7:52 PM

So, I think this was actually working as intended.

The limit is off by default. Turning the limit on I think is essentially used to bisect to a particular if conversion within a given run over a module for debugging.

I'm not suggesting it should keep using statistics to do this bisection, just pointing out that the "global limit" thing is actually "global stop counter for debugging and bisection". Renaming it would seem appropriate. =]

Maybe we should switch to a DebugCounter?

Maybe we should switch to a DebugCounter?

That would make sense. But then I think a bunch of the counting and limiting here go away with that rather than shifting to local counting.

craig.topper planned changes to this revision.May 17 2017, 9:12 PM
craig.topper abandoned this revision.Aug 8 2017, 9:33 AM