Replace use of OperationState with builder::create in GPU Kernel Outlining (NFC)

OperationState is a low level API that is rarely indicated, the builder
API convenient wrapper is preferred when possible.
This commit is contained in:
Mehdi Amini 2021-03-12 00:12:50 +00:00
parent e8e6817d00
commit e1364f1068
1 changed files with 2 additions and 4 deletions

View File

@ -283,10 +283,8 @@ private:
// and then this needs to use the OpBuilder.
auto context = getOperation().getContext();
OpBuilder builder(context);
OperationState state(kernelFunc.getLoc(),
gpu::GPUModuleOp::getOperationName());
gpu::GPUModuleOp::build(builder, state, kernelFunc.getName());
auto kernelModule = cast<gpu::GPUModuleOp>(Operation::create(state));
auto kernelModule = builder.create<gpu::GPUModuleOp>(kernelFunc.getLoc(),
kernelFunc.getName());
SymbolTable symbolTable(kernelModule);
symbolTable.insert(kernelFunc);