@@ -70,9 +70,9 @@ createGlobalVarForEntryPointArgument(OpBuilder &builder, spirv::FuncOp funcOp,
7070 varType =
7171 spirv::PointerType::get (varPointeeType, varPtrType.getStorageClass ());
7272
73- return builder. create < spirv::GlobalVariableOp>(
74- funcOp. getLoc (), varType, varName, abiInfo.getDescriptorSet (),
75- abiInfo.getBinding ());
73+ return spirv::GlobalVariableOp::create (builder, funcOp. getLoc (), varType,
74+ varName, abiInfo.getDescriptorSet (),
75+ abiInfo.getBinding ());
7676}
7777
7878// / Gets the global variables that need to be specified as interface variable
@@ -146,17 +146,17 @@ static LogicalResult lowerEntryPointABIAttr(spirv::FuncOp funcOp,
146146 return funcOp.emitRemark (" lower entry point failure: could not select "
147147 " execution model based on 'spirv.target_env'" );
148148
149- builder. create < spirv::EntryPointOp>( funcOp.getLoc (), *executionModel, funcOp,
150- interfaceVars);
149+ spirv::EntryPointOp::create (builder, funcOp.getLoc (), *executionModel, funcOp,
150+ interfaceVars);
151151
152152 // Specifies the spirv.ExecutionModeOp.
153153 if (DenseI32ArrayAttr workgroupSizeAttr = entryPointAttr.getWorkgroupSize ()) {
154154 std::optional<ArrayRef<spirv::Capability>> caps =
155155 spirv::getCapabilities (spirv::ExecutionMode::LocalSize);
156156 if (!caps || targetEnv.allows (*caps)) {
157- builder. create < spirv::ExecutionModeOp>( funcOp.getLoc (), funcOp,
158- spirv::ExecutionMode::LocalSize,
159- workgroupSizeAttr.asArrayRef ());
157+ spirv::ExecutionModeOp::create (builder, funcOp.getLoc (), funcOp,
158+ spirv::ExecutionMode::LocalSize,
159+ workgroupSizeAttr.asArrayRef ());
160160 // Erase workgroup size.
161161 entryPointAttr = spirv::EntryPointABIAttr::get (
162162 entryPointAttr.getContext (), DenseI32ArrayAttr (),
@@ -167,9 +167,9 @@ static LogicalResult lowerEntryPointABIAttr(spirv::FuncOp funcOp,
167167 std::optional<ArrayRef<spirv::Capability>> caps =
168168 spirv::getCapabilities (spirv::ExecutionMode::SubgroupSize);
169169 if (!caps || targetEnv.allows (*caps)) {
170- builder. create < spirv::ExecutionModeOp>( funcOp.getLoc (), funcOp,
171- spirv::ExecutionMode::SubgroupSize,
172- *subgroupSize);
170+ spirv::ExecutionModeOp::create (builder, funcOp.getLoc (), funcOp,
171+ spirv::ExecutionMode::SubgroupSize,
172+ *subgroupSize);
173173 // Erase subgroup size.
174174 entryPointAttr = spirv::EntryPointABIAttr::get (
175175 entryPointAttr.getContext (), entryPointAttr.getWorkgroupSize (),
@@ -180,8 +180,8 @@ static LogicalResult lowerEntryPointABIAttr(spirv::FuncOp funcOp,
180180 std::optional<ArrayRef<spirv::Capability>> caps =
181181 spirv::getCapabilities (spirv::ExecutionMode::SignedZeroInfNanPreserve);
182182 if (!caps || targetEnv.allows (*caps)) {
183- builder. create < spirv::ExecutionModeOp> (
184- funcOp.getLoc (), funcOp,
183+ spirv::ExecutionModeOp::create (
184+ builder, funcOp.getLoc (), funcOp,
185185 spirv::ExecutionMode::SignedZeroInfNanPreserve, *targetWidth);
186186 // Erase target width.
187187 entryPointAttr = spirv::EntryPointABIAttr::get (
@@ -259,7 +259,7 @@ LogicalResult ProcessInterfaceVarABI::matchAndRewrite(
259259
260260 // Insert spirv::AddressOf and spirv::AccessChain operations.
261261 Value replacement =
262- rewriter. create < spirv::AddressOfOp>( funcOp.getLoc (), var);
262+ spirv::AddressOfOp::create (rewriter, funcOp.getLoc (), var);
263263 // Check if the arg is a scalar or vector type. In that case, the value
264264 // needs to be loaded into registers.
265265 // TODO: This is loading value of the scalar into registers
@@ -269,9 +269,9 @@ LogicalResult ProcessInterfaceVarABI::matchAndRewrite(
269269 if (cast<spirv::SPIRVType>(argType.value ()).isScalarOrVector ()) {
270270 auto zero =
271271 spirv::ConstantOp::getZero (indexType, funcOp.getLoc (), rewriter);
272- auto loadPtr = rewriter. create < spirv::AccessChainOp> (
273- funcOp.getLoc (), replacement, zero.getConstant ());
274- replacement = rewriter. create < spirv::LoadOp>( funcOp.getLoc (), loadPtr);
272+ auto loadPtr = spirv::AccessChainOp::create (
273+ rewriter, funcOp.getLoc (), replacement, zero.getConstant ());
274+ replacement = spirv::LoadOp::create (rewriter, funcOp.getLoc (), loadPtr);
275275 }
276276 signatureConverter.remapInput (argType.index (), replacement);
277277 }
@@ -308,7 +308,7 @@ void LowerABIAttributesPass::runOnOperation() {
308308 ValueRange inputs, Location loc) {
309309 if (inputs.size () != 1 || !isa<spirv::PointerType>(inputs[0 ].getType ()))
310310 return Value ();
311- return builder. create < spirv::BitcastOp>( loc, type, inputs[0 ]).getResult ();
311+ return spirv::BitcastOp::create (builder, loc, type, inputs[0 ]).getResult ();
312312 });
313313
314314 RewritePatternSet patterns (context);
0 commit comments