This is an archive of the discontinued LLVM Phabricator instance.

[GPGPU] Make sure that all parameter dimensions are set in schedule
ClosedPublic

Authored by grosser on Aug 2 2017, 2:42 PM.

Details

Summary

In case the option -polly-ignore-parameter-bounds is set, not all parameters
will be added to context and domains. This is useful to keep the size of the
sets and maps we work with small. Unfortunately, for AST generation it is
necessary to ensure all parameters are part of the schedule tree. Hence,
we modify the GPGPU code generation to make sure this is the case.

To obtain the necessary information we expose a new function
Scop::getFullParamSpace(). We also make a couple of functions const to be
able to make SCoP::getFullParamSpace() const.

Event Timeline

grosser created this revision.Aug 2 2017, 2:42 PM
bollu edited edge metadata.Aug 2 2017, 3:45 PM

@grosser - Can you comment on my concern about Fortran arrays? See ScopArrayInfo::setAndApplyFAD for this new parameter synthesis.

include/polly/ScopInfo.h
2519
  • Nit: In case the full set of parameters is needed, see @getFullParamSpace (bold missing?)
2525
  • Nit: all parameter s. (bold missing?)
lib/Analysis/ScopInfo.cpp
4311

I am not sure if only taking the SCEVs are enough. IIRC, if an array is a fortran array, it can have an extra "virtual parameter" in the outermost dimension that has no corresponding SCEV. That's a corner case.

4315

Nit: not sure if auto is valid here, because I had to lookup that Parameter would be a const SCEV *

grosser updated this revision to Diff 109488.Aug 2 2017, 11:13 PM
grosser marked 3 inline comments as done.

Addressed Siddharth's comments

grosser marked an inline comment as done.Aug 2 2017, 11:14 PM

I addressed your comments.

bollu accepted this revision.Aug 2 2017, 11:51 PM

LGTM. Please refactor the Fortran changes to an [NFC] patch before applying this patch, if it makes sense.

This revision is now accepted and ready to land.Aug 2 2017, 11:51 PM
This revision was automatically updated to reflect the committed changes.