diff --git a/mlir/include/mlir/Dialect/SPIRV/SPIRVOps.td b/mlir/include/mlir/Dialect/SPIRV/SPIRVOps.td --- a/mlir/include/mlir/Dialect/SPIRV/SPIRVOps.td +++ b/mlir/include/mlir/Dialect/SPIRV/SPIRVOps.td @@ -262,9 +262,13 @@ SPV_Type:$value ); - let builders = [OpBuilder<[{Builder *builder, OperationState &state, - Value basePtr, /*optional*/IntegerAttr memory_access, - /*optional*/IntegerAttr alignment}]>]; + let builders = [ + OpBuilder<[{ + Builder *builder, OperationState &state, + Value basePtr, IntegerAttr memory_access = {}, + IntegerAttr alignment = {} + }]> + ]; } // ----- @@ -358,7 +362,7 @@ let builders = [ OpBuilder<"Builder *builder, OperationState &state, " - "Value ptr, Value value, ArrayRef namedAttrs", [{ + "Value ptr, Value value, ArrayRef namedAttrs = {}", [{ state.addOperands(ptr); state.addOperands(value); state.addAttributes(namedAttrs); diff --git a/mlir/lib/Conversion/StandardToSPIRV/ConvertStandardToSPIRV.cpp b/mlir/lib/Conversion/StandardToSPIRV/ConvertStandardToSPIRV.cpp --- a/mlir/lib/Conversion/StandardToSPIRV/ConvertStandardToSPIRV.cpp +++ b/mlir/lib/Conversion/StandardToSPIRV/ConvertStandardToSPIRV.cpp @@ -334,9 +334,7 @@ auto loadPtr = getElementPtr(rewriter, typeConverter, loadOp.getLoc(), loadOp.memref().getType().cast(), loadOperands.memref(), loadOperands.indices()); - rewriter.replaceOpWithNewOp(loadOp, loadPtr, - /*memory_access =*/nullptr, - /*alignment =*/nullptr); + rewriter.replaceOpWithNewOp(loadOp, loadPtr); return matchSuccess(); } @@ -381,9 +379,7 @@ storeOp.memref().getType().cast(), storeOperands.memref(), storeOperands.indices()); rewriter.replaceOpWithNewOp(storeOp, storePtr, - storeOperands.value(), - /*memory_access =*/nullptr, - /*alignment =*/nullptr); + storeOperands.value()); return matchSuccess(); } diff --git a/mlir/lib/Dialect/SPIRV/SPIRVLowering.cpp b/mlir/lib/Dialect/SPIRV/SPIRVLowering.cpp --- a/mlir/lib/Dialect/SPIRV/SPIRVLowering.cpp +++ b/mlir/lib/Dialect/SPIRV/SPIRVLowering.cpp @@ -288,9 +288,7 @@ spirv::GlobalVariableOp varOp = getOrInsertBuiltinVariable(moduleOp, op->getLoc(), builtin, builder); Value ptr = builder.create(op->getLoc(), varOp); - return builder.create(op->getLoc(), ptr, - /*memory_access =*/nullptr, - /*alignment =*/nullptr); + return builder.create(op->getLoc(), ptr); } //===----------------------------------------------------------------------===// diff --git a/mlir/lib/Dialect/SPIRV/Transforms/LowerABIAttributesPass.cpp b/mlir/lib/Dialect/SPIRV/Transforms/LowerABIAttributesPass.cpp --- a/mlir/lib/Dialect/SPIRV/Transforms/LowerABIAttributesPass.cpp +++ b/mlir/lib/Dialect/SPIRV/Transforms/LowerABIAttributesPass.cpp @@ -191,9 +191,7 @@ spirv::ConstantOp::getZero(indexType, funcOp.getLoc(), &rewriter); auto loadPtr = rewriter.create( funcOp.getLoc(), replacement, zero.constant()); - replacement = rewriter.create(funcOp.getLoc(), loadPtr, - /*memory_access=*/nullptr, - /*alignment=*/nullptr); + replacement = rewriter.create(funcOp.getLoc(), loadPtr); } signatureConverter.remapInput(argType.index(), replacement); }