[mlir][sparse] Add another call to ConvertVectorToLLVMPass, to lower the vector opera...
authorbixia1 <bixia@google.com>
Tue, 13 Dec 2022 18:41:12 +0000 (10:41 -0800)
committerbixia1 <bixia@google.com>
Wed, 14 Dec 2022 23:06:34 +0000 (15:06 -0800)
Run sparse_tanh with vectorization.

Reviewed By: aartbik

Differential Revision: https://reviews.llvm.org/D139958

mlir/lib/Dialect/SparseTensor/Pipelines/SparseTensorPipelines.cpp
mlir/test/Integration/Dialect/SparseTensor/CPU/sparse_tanh.mlir

index 92fe090fb4e1fc186388de4adc4c334f40c2db66..2634f9948c1dd153457192f3098ce06e5226d7cc 100644 (file)
@@ -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());
index f2cd3e3003d8f4219e9ac8404851571c9d23031e..81acfeb7bfb483ccc2f331080ec173973a07e156 100644 (file)
 // 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" ] }>