[PATCH] D30732: LoopVectorizer: let target limit memory intensive loops

Jonas Paulsson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 9 03:23:18 PST 2017


jonpa updated this revision to Diff 91154.
jonpa added a comment.

In https://reviews.llvm.org/D30732#695820, @mssimpso wrote:

> I think it might be better if the store-counting part of this was located in the SystemZ TTI implementation. So the hook would look something like TTI.hookName(WideningDecions, VF). What do you think? Letting the targets see all the memory access decisions would probably be more generally useful. And I believe the only thing that would have to be exposed is the InstWidening enum.


I was suspecting this might be generally preferred... :-)

- Made the new hook instead return a pair of values {Max, Count}, with the Loop, WideningDecisions and VF as arguments (put new hook by getOperandsScalarizationOverhead() and enableAggressiveInterleaving(), even though this seems to be in the 'Scalar' section of the header file which makes me think this is actually not the right place?) .

- Factored out InstWidening and made a new class DecisionList with a member getWideningDecision() in order to avoid having to duplicate that code. Put it in TargetInstrInfo.h. Is it ok to make these in the open, or should they perhaps be wrapped in a namespace or something?

- Moved the actual counting of stores to the SystemZ implementation.

- Added a short debug output in case this triggers.

> Let me make sure that I understand: Are you trying to limit the number of store instructions/loop or are you trying to limit the numbers of stores/cycle?

It's about limiting the general input of stores into the processor.


https://reviews.llvm.org/D30732

Files:
  include/llvm/Analysis/TargetTransformInfo.h
  include/llvm/Analysis/TargetTransformInfoImpl.h
  lib/Analysis/TargetTransformInfo.cpp
  lib/Target/SystemZ/SystemZTargetTransformInfo.cpp
  lib/Target/SystemZ/SystemZTargetTransformInfo.h
  lib/Transforms/Vectorize/LoopVectorize.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D30732.91154.patch
Type: text/x-patch
Size: 11796 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170309/8a40058a/attachment.bin>


More information about the llvm-commits mailing list