@@ -70,9 +70,9 @@ createGlobalVarForEntryPointArgument(OpBuilder &builder, spirv::FuncOp funcOp,
70
70
varType =
71
71
spirv::PointerType::get (varPointeeType, varPtrType.getStorageClass ());
72
72
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 ());
76
76
}
77
77
78
78
// / Gets the global variables that need to be specified as interface variable
@@ -146,17 +146,17 @@ static LogicalResult lowerEntryPointABIAttr(spirv::FuncOp funcOp,
146
146
return funcOp.emitRemark (" lower entry point failure: could not select "
147
147
" execution model based on 'spirv.target_env'" );
148
148
149
- builder. create < spirv::EntryPointOp>( funcOp.getLoc (), *executionModel, funcOp,
150
- interfaceVars);
149
+ spirv::EntryPointOp::create (builder, funcOp.getLoc (), *executionModel, funcOp,
150
+ interfaceVars);
151
151
152
152
// Specifies the spirv.ExecutionModeOp.
153
153
if (DenseI32ArrayAttr workgroupSizeAttr = entryPointAttr.getWorkgroupSize ()) {
154
154
std::optional<ArrayRef<spirv::Capability>> caps =
155
155
spirv::getCapabilities (spirv::ExecutionMode::LocalSize);
156
156
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 ());
160
160
// Erase workgroup size.
161
161
entryPointAttr = spirv::EntryPointABIAttr::get (
162
162
entryPointAttr.getContext (), DenseI32ArrayAttr (),
@@ -167,9 +167,9 @@ static LogicalResult lowerEntryPointABIAttr(spirv::FuncOp funcOp,
167
167
std::optional<ArrayRef<spirv::Capability>> caps =
168
168
spirv::getCapabilities (spirv::ExecutionMode::SubgroupSize);
169
169
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);
173
173
// Erase subgroup size.
174
174
entryPointAttr = spirv::EntryPointABIAttr::get (
175
175
entryPointAttr.getContext (), entryPointAttr.getWorkgroupSize (),
@@ -180,8 +180,8 @@ static LogicalResult lowerEntryPointABIAttr(spirv::FuncOp funcOp,
180
180
std::optional<ArrayRef<spirv::Capability>> caps =
181
181
spirv::getCapabilities (spirv::ExecutionMode::SignedZeroInfNanPreserve);
182
182
if (!caps || targetEnv.allows (*caps)) {
183
- builder. create < spirv::ExecutionModeOp> (
184
- funcOp.getLoc (), funcOp,
183
+ spirv::ExecutionModeOp::create (
184
+ builder, funcOp.getLoc (), funcOp,
185
185
spirv::ExecutionMode::SignedZeroInfNanPreserve, *targetWidth);
186
186
// Erase target width.
187
187
entryPointAttr = spirv::EntryPointABIAttr::get (
@@ -259,7 +259,7 @@ LogicalResult ProcessInterfaceVarABI::matchAndRewrite(
259
259
260
260
// Insert spirv::AddressOf and spirv::AccessChain operations.
261
261
Value replacement =
262
- rewriter. create < spirv::AddressOfOp>( funcOp.getLoc (), var);
262
+ spirv::AddressOfOp::create (rewriter, funcOp.getLoc (), var);
263
263
// Check if the arg is a scalar or vector type. In that case, the value
264
264
// needs to be loaded into registers.
265
265
// TODO: This is loading value of the scalar into registers
@@ -269,9 +269,9 @@ LogicalResult ProcessInterfaceVarABI::matchAndRewrite(
269
269
if (cast<spirv::SPIRVType>(argType.value ()).isScalarOrVector ()) {
270
270
auto zero =
271
271
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);
275
275
}
276
276
signatureConverter.remapInput (argType.index (), replacement);
277
277
}
@@ -308,7 +308,7 @@ void LowerABIAttributesPass::runOnOperation() {
308
308
ValueRange inputs, Location loc) {
309
309
if (inputs.size () != 1 || !isa<spirv::PointerType>(inputs[0 ].getType ()))
310
310
return Value ();
311
- return builder. create < spirv::BitcastOp>( loc, type, inputs[0 ]).getResult ();
311
+ return spirv::BitcastOp::create (builder, loc, type, inputs[0 ]).getResult ();
312
312
});
313
313
314
314
RewritePatternSet patterns (context);
0 commit comments