This is an archive of the discontinued LLVM Phabricator instance.

[GPGPU] Simplify PPCGSCop to reduce compile time [NFC]
ClosedPublic

Authored by grosser on Aug 18 2017, 3:50 AM.

Details

Summary

Drop unused parameter dimensions to reduce the size of the sets we are working
with. Especially the computed dependences tend to accumulate a lot of parameters
that are present in the input memory accesses, but often not necessary to
express the actual dependences. As isl represents maps and sets with dense
matrices, reducing the dimensionality of isl sets commonly reduces code
generation performance.

This reduces compile time from 17 to 11 seconds for our test case. While this is
not impressive, this patch helped me to identify the previous two performance
improvements and additionally also increases readability of the isl data
structures we use.

Diff Detail

Repository
rL LLVM

Event Timeline

grosser created this revision.Aug 18 2017, 3:50 AM
bollu edited edge metadata.Aug 18 2017, 4:45 AM

Other than comments, LGTM :)

lib/CodeGen/PPCGCodeGeneration.cpp
2639 ↗(On Diff #111651)

Please name this with the function intent. suggestion: RemoveUnusedDims.

2643 ↗(On Diff #111651)

const int Dim = i - Removed.

2653 ↗(On Diff #111651)

Alternate way without having to name the Lambda, just move the lambda into the callsite?

UMap.foreach_map([&New](...) {...});
2661 ↗(On Diff #111651)

Similar comment: RemoveUnusedDims, maybe.

2665 ↗(On Diff #111651)

const int Dim = i - Removed.

2675 ↗(On Diff #111651)

Similar comment: Consider moving Lambda into callsite?

3207 ↗(On Diff #111651)

Nit: Move this about the has_permutable?

bollu accepted this revision.Aug 18 2017, 4:51 AM
This revision is now accepted and ready to land.Aug 18 2017, 4:51 AM
This revision was automatically updated to reflect the committed changes.