Page MenuHomePhabricator

[docs] loop pragmas
Needs ReviewPublic

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

Details

Summary

Following our discussion on the cfe dev list
(http://lists.llvm.org/pipermail/cfe-dev/2019-August/063054.html), I have added
a paragraph that is explicit about transformation options implying
the corresponding transformation.

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

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

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

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.