[PATCH] D72336: [mlir] Create a gpu.module operation for the GPU Dialect.
Theodore Popp via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 9 01:49:33 PST 2020
tpopp added inline comments.
================
Comment at: mlir/lib/Dialect/GPU/IR/GPUDialect.cpp:822
+ OperationState state(loc, getOperationName());
+ Builder builder(loc->getContext());
+ GpuModuleOp::build(&builder, state, name);
----------------
herhut wrote:
> rriddle wrote:
> > Why is this method necessary?
> It is the equivalent of ModuleOp::create and FuncOp::create to allow creation of modules outside the context of a surrounding module. We could refactor the code here to use a builder, as the module is inserted into a surrounding module but in general that might not be the case. Or is there a way to have create methods generated?
We need GPUModuleOp::build because we have to ensure a terminator, we can't use a generated create method as I understand it. The create method is to be consistent with similar ops like those that Stephan referenced.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D72336/new/
https://reviews.llvm.org/D72336
More information about the llvm-commits
mailing list