This is an archive of the discontinued LLVM Phabricator instance.

ScopDetection: Only detect scops that have at least one read and one write
ClosedPublic

Authored by grosser on Feb 18 2015, 1:12 PM.

Details

Summary

Scops that only read seem generally uninteresting and scops that only write are
most likely initializations where there is also little to optimize. To not
waste compile time we bail early.

Diff Detail

Event Timeline

grosser updated this revision to Diff 20215.Feb 18 2015, 1:12 PM
grosser retitled this revision from to ScopDetection: Only detect scops that have at least one read and one write.
grosser updated this object.
grosser edited the test plan for this revision. (Show Details)
grosser added a subscriber: Unknown Object (MLST).
sebpop edited edge metadata.Feb 18 2015, 6:00 PM

Good catch to speed up compile time.
LGTM.

lib/Analysis/ScopDetection.cpp
881

I always questioned the necessity of double negatives: "not unprofitable" = "profitable".
I find "profitable" easier to read.

This revision was automatically updated to reflect the committed changes.
grosser added inline comments.Feb 18 2015, 9:44 PM
lib/Analysis/ScopDetection.cpp
881

Yes, the alternative would be to call this only-profitable, but then the option would need to be '-polly-detect-only-profitable=false', which seems rather long to me.

For now, I left it as it is. Please feel free to suggest a better option.

jdoerfert edited edge metadata.Feb 19 2015, 6:22 AM

Hey Tobias,

do you kow how much we actually gain by your change? Why shouldn't we
keep (and delete) SCoPs that have no stores (or at least delete the
loads and let the other passes delete the rest)? Why shouldn't we look at
generating memset intrinsics for loops that only write?

Regarding the patch, could you please comment your member variables
(even though it's pretty obvious).

  • Johannes