[Mlir-commits] [mlir] bfad072 - [mlir][sparse] Add another call to ConvertVectorToLLVMPass, to lower the vector operations added by ConvertMathToLLVMPass.
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Wed Dec 14 15:06:40 PST 2022
Author: bixia1
Date: 2022-12-14T15:06:34-08:00
New Revision: bfad07268bfeb350756cd6d07314436013e92182
URL: https://github.com/llvm/llvm-project/commit/bfad07268bfeb350756cd6d07314436013e92182
DIFF: https://github.com/llvm/llvm-project/commit/bfad07268bfeb350756cd6d07314436013e92182.diff
LOG: [mlir][sparse] Add another call to ConvertVectorToLLVMPass, to lower the vector operations added by ConvertMathToLLVMPass.
Run sparse_tanh with vectorization.
Reviewed By: aartbik
Differential Revision: https://reviews.llvm.org/D139958
Added:
Modified:
mlir/lib/Dialect/SparseTensor/Pipelines/SparseTensorPipelines.cpp
mlir/test/Integration/Dialect/SparseTensor/CPU/sparse_tanh.mlir
Removed:
################################################################################
diff --git a/mlir/lib/Dialect/SparseTensor/Pipelines/SparseTensorPipelines.cpp b/mlir/lib/Dialect/SparseTensor/Pipelines/SparseTensorPipelines.cpp
index 92fe090fb4e1f..2634f9948c1dd 100644
--- a/mlir/lib/Dialect/SparseTensor/Pipelines/SparseTensorPipelines.cpp
+++ b/mlir/lib/Dialect/SparseTensor/Pipelines/SparseTensorPipelines.cpp
@@ -79,6 +79,8 @@ void mlir::sparse_tensor::buildSparseCompiler(
pm.addNestedPass<func::FuncOp>(createConvertMathToLLVMPass());
pm.addPass(createConvertMathToLibmPass());
pm.addPass(createConvertComplexToLibmPass());
+ // Repeat convert-vector-to-llvm.
+ pm.addPass(createConvertVectorToLLVMPass(options.lowerVectorToLLVMOptions()));
pm.addPass(createConvertComplexToLLVMPass());
pm.addPass(createConvertFuncToLLVMPass());
pm.addPass(createReconcileUnrealizedCastsPass());
diff --git a/mlir/test/Integration/Dialect/SparseTensor/CPU/sparse_tanh.mlir b/mlir/test/Integration/Dialect/SparseTensor/CPU/sparse_tanh.mlir
index f2cd3e3003d8f..81acfeb7bfb48 100644
--- a/mlir/test/Integration/Dialect/SparseTensor/CPU/sparse_tanh.mlir
+++ b/mlir/test/Integration/Dialect/SparseTensor/CPU/sparse_tanh.mlir
@@ -10,6 +10,10 @@
// Do the same run, but now with direct IR generation.
// REDEFINE: %{option} = enable-runtime-library=false
// RUN: %{command}
+//
+// Do the same run, but now with direct IR generation and vectorization.
+// REDEFINE: %{option} = "enable-runtime-library=false vl=2 reassociate-fp-reductions=true enable-index-optimizations=true"
+// RUN: %{command}
#SparseVector = #sparse_tensor.encoding<{ dimLevelType = [ "compressed" ] }>
More information about the Mlir-commits
mailing list