This is an archive of the discontinued LLVM Phabricator instance.

[docs] loop pragmas
ClosedPublic

Authored by SjoerdMeijer on Aug 13 2019, 11:28 PM.

Details

Diff Detail

Event Timeline

SjoerdMeijer created this revision.Aug 13 2019, 11:28 PM

Since this is user documentation, we should only add it here once it is true.

docs/LanguageExtensions.rst
3068–3069 ↗(On Diff #215031)

vectorize_width also "controls" a transformation. Is it that in our interpretation, vectorize(enable) overrides the profitability heuristic by taking out the "do not apply at all" option without setting any other option?

SjoerdMeijer marked an inline comment as done.Aug 14 2019, 10:42 AM

Since this is user documentation, we should only add it here once it is true.

Yep, good point, I also wanted to capture our discussions on the list. But yes, let's hold this back until we're ready with the pragmas.

docs/LanguageExtensions.rst
3068–3069 ↗(On Diff #215031)

I think I need to think a little bit more about this:

Is it that in our interpretation, vectorize(enable) overrides the profitability heuristic by taking out the "do not apply at all" option without setting any other option?

but I would answer this with "yes". But just checking, what exactly do you mean with "do not apply at all option"?

Meinersbur added inline comments.Aug 14 2019, 1:08 PM
docs/LanguageExtensions.rst
3068–3069 ↗(On Diff #215031)

I unfortunately mixed two meanings of "option" here:

  1. option as in optimization setting
  2. option as in candidate to choose from.

Let's take a look on the loop vectorizer. The profitability heuristic's job is too choose the "best" candidate out of the following list (independently of how LoopVectorize's heuristic is actually implemented; these might be decision made independently of each other, but as the user still sees one of the following outcomes):

0) no vectorization (the "do not apply at all" option/candidate)
1a) vec width=2 with epilogue
1b) vec width=2 without epilogue
2a) vec width=4 with epilogue
2b) vec width=4 without epilogue
3a) vec width=8 with epilogue
3b) vec width=8 without epilogue
...

vectorize(enable) with remove 0) as a candidate. vecorize(disable) will remove all expect 0) as a candidate.

The option/settings are vectorize_width and vectorize_predicate (and interleave_count). For instance vectorize_width(4) would remove 1) and 3)+ from the candidate list. vectorize_predicate(enable) takes any a) candidate from the list. What we were discussing was that these settings would remove 0) from the candidate list as well.

Many thanks for your clarification!

What we were discussing was that these settings would remove 0) from the candidate list as well.

Yep, that's crystal clear now.
And my expectation would indeed be that this would be the case.

SjoerdMeijer added a comment.EditedOct 10 2019, 1:42 AM

I have committed all my pragma patches, so now back to the last bit, this doc update.
This doc change should now reflect our implementation. Are we happy for this to go in?

hsaito added inline comments.Oct 10 2019, 9:50 AM
docs/LanguageExtensions.rst
3069 ↗(On Diff #215031)

and there loop hints ==> and there are loop hints

Thanks! Typo fixed.

hsaito accepted this revision.Oct 10 2019, 11:18 AM

LGTM. Please wait for a few days in case others have more comments.

This revision is now accepted and ready to land.Oct 10 2019, 11:18 AM

Sure, will do, thanks again for taking a look.

This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptOct 14 2019, 12:47 AM