[mlir] Add ComplexDialect to SCF->GPU pass.
authorAlexander Belyaev <pifon@google.com>
Wed, 20 Jan 2021 20:11:49 +0000 (21:11 +0100)
committerAlexander Belyaev <pifon@google.com>
Wed, 20 Jan 2021 20:18:09 +0000 (21:18 +0100)
mlir/lib/Conversion/SCFToGPU/CMakeLists.txt
mlir/lib/Conversion/SCFToGPU/SCFToGPUPass.cpp

index 10fed81..f3de289 100644 (file)
@@ -11,6 +11,7 @@ add_mlir_conversion_library(MLIRSCFToGPU
   LINK_LIBS PUBLIC
   MLIRAffine
   MLIRAffineToStandard
+  MLIRComplex
   MLIRGPU
   MLIRIR
   MLIRLinalg
index 2941b40..66fbacf 100644 (file)
@@ -10,6 +10,7 @@
 #include "../PassDetail.h"
 #include "mlir/Conversion/SCFToGPU/SCFToGPU.h"
 #include "mlir/Dialect/Affine/IR/AffineOps.h"
+#include "mlir/Dialect/Complex/IR/Complex.h"
 #include "mlir/Dialect/GPU/GPUDialect.h"
 #include "mlir/Dialect/SCF/SCF.h"
 #include "mlir/Dialect/StandardOps/IR/Ops.h"
@@ -49,10 +50,9 @@ struct ParallelLoopToGpuPass
     OwningRewritePatternList patterns;
     populateParallelLoopToGPUPatterns(patterns, &getContext());
     ConversionTarget target(getContext());
-    target.addLegalDialect<StandardOpsDialect>();
-    target.addLegalDialect<AffineDialect>();
-    target.addLegalDialect<gpu::GPUDialect>();
-    target.addLegalDialect<scf::SCFDialect>();
+    target.addLegalDialect<AffineDialect, complex::ComplexDialect,
+                           gpu::GPUDialect, scf::SCFDialect,
+                           StandardOpsDialect>();
     configureParallelLoopToGPULegality(target);
     if (failed(applyPartialConversion(getOperation(), target,
                                       std::move(patterns))))