[PATCH] D80747: [mlir][SCFToGPU] Remove conversions from scf.for to gpu.launch.
Uday Bondhugula via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu May 28 14:53:06 PDT 2020
bondhugula requested changes to this revision.
bondhugula added inline comments.
This revision now requires changes to proceed.
================
Comment at: mlir/include/mlir/Conversion/Passes.td:183
-def ConvertSimpleSCFToGPU : FunctionPass<"convert-scf-to-gpu"> {
- let summary = "Convert top-level loops to GPU kernels";
- let constructor = "mlir::createSimpleSCFToGPUPass()";
+def ConvertAffineForToGPU : FunctionPass<"convert-affine-for-to-gpu"> {
+ let summary = "Convert top-level AffineFor Ops to GPU kernels";
----------------
You could perhaps add a TODO here or somewhere else to the effect: "Consider removing this in favor of affine.for -> affine.parallel detection followed by an affine.parallel -> scf.parallel -> gpu.launch conversion".
================
Comment at: mlir/lib/Conversion/SCFToGPU/SCFToGPU.cpp:123
- if (!(forOp = dyn_cast<OpTy>(nested)))
+ if (!(forOp = dyn_cast<AffineForOp>(nested)))
return nested->emitError("expected a nested loop");
----------------
You don't need to assign to `forOp`, and also this can just be an isa instead of dyn_cast.
```
if (!isa<AffineForOp>(nested))
...
```
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D80747/new/
https://reviews.llvm.org/D80747
More information about the llvm-commits
mailing list