diff options
| author | Benjamin Kramer <benny.kra@googlemail.com> | 2018-08-27 17:29:43 +0000 |
|---|---|---|
| committer | Benjamin Kramer <benny.kra@googlemail.com> | 2018-08-27 17:29:43 +0000 |
| commit | 759e7d98199a8320a9d765002aac059bcdb69e1e (patch) | |
| tree | 0c1ec917e962f8bd0366eb8ae7489636800e6825 /llvm/lib/Target | |
| parent | e6d5fd818f0d993ebf880fbd8dbbfbca70f879c7 (diff) | |
| download | bcm5719-llvm-759e7d98199a8320a9d765002aac059bcdb69e1e.tar.gz bcm5719-llvm-759e7d98199a8320a9d765002aac059bcdb69e1e.zip | |
[NVPTX] Implement isLegalToVectorizeLoadChain
This lets LSV nicely split up underaligned chains.
Differential Revision: https://reviews.llvm.org/D51306
llvm-svn: 340760
Diffstat (limited to 'llvm/lib/Target')
| -rw-r--r-- | llvm/lib/Target/NVPTX/NVPTXTargetTransformInfo.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/llvm/lib/Target/NVPTX/NVPTXTargetTransformInfo.h b/llvm/lib/Target/NVPTX/NVPTXTargetTransformInfo.h index a631055d36a..14e93f7447d 100644 --- a/llvm/lib/Target/NVPTX/NVPTXTargetTransformInfo.h +++ b/llvm/lib/Target/NVPTX/NVPTXTargetTransformInfo.h @@ -49,6 +49,19 @@ public: return AddressSpace::ADDRESS_SPACE_GENERIC; } + // Loads and stores can be vectorized if the alignment is at least as big as + // the load/store we want to vectorize. + bool isLegalToVectorizeLoadChain(unsigned ChainSizeInBytes, + unsigned Alignment, + unsigned AddrSpace) const { + return Alignment >= ChainSizeInBytes; + } + bool isLegalToVectorizeStoreChain(unsigned ChainSizeInBytes, + unsigned Alignment, + unsigned AddrSpace) const { + return isLegalToVectorizeLoadChain(ChainSizeInBytes, Alignment, AddrSpace); + } + // NVPTX has infinite registers of all kinds, but the actual machine doesn't. // We conservatively return 1 here which is just enough to enable the // vectorizers but disables heuristics based on the number of registers. |

