diff options
author | Benjamin Maxwell <benjamin.maxwell@arm.com> | 2023-08-09 09:03:00 +0000 |
---|---|---|
committer | Benjamin Maxwell <benjamin.maxwell@arm.com> | 2023-08-09 11:47:18 +0000 |
commit | 490dae26cb3bee2e8401e4c2a7ad3e0996be67d0 (patch) | |
tree | dcfabe2d4e2069e98fe9e94852e5f83577dfde62 /clang/lib/Frontend/CompilerInvocation.cpp | |
parent | 0bb4d4d32fc46cf3a2a343c878c9e9bb09fc7e99 (diff) | |
download | llvm-490dae26cb3bee2e8401e4c2a7ad3e0996be67d0.zip llvm-490dae26cb3bee2e8401e4c2a7ad3e0996be67d0.tar.gz llvm-490dae26cb3bee2e8401e4c2a7ad3e0996be67d0.tar.bz2 |
[mlir][VectorOps] Use SCF for vector.print and allow scalable vectors
Reland of the original patch after updating the Python binding tests and
a few CUDA/GPU MLIR tests.
This patch splits the lowering of vector.print into first converting
an n-D print into a loop of scalar prints of the elements, then a second
pass that converts those scalar prints into the runtime calls. The
former is done in VectorToSCF and the latter in VectorToLLVM.
The main reason for this is to allow printing scalable vector types,
which are not possible to fully unroll at compile time, though this
also avoids fully unrolling very large vectors.
To allow VectorToSCF to add the necessary punctuation between vectors
and elements, a "punctuation" attribute has been added to vector.print.
This abstracts calling the runtime functions such as printNewline(),
without leaking the LLVM details into the higher abstraction levels.
For example:
vector.print <comma>
lowers to
llvm.call @printComma() : () -> ()
The output format and runtime functions remain the same, which avoids
the need to alter a large number of tests (aside from the pipelines).
Reviewed By: awarzynski, c-rhodes, aartbik
Differential Revision: https://reviews.llvm.org/D156519
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
0 files changed, 0 insertions, 0 deletions