diff --git a/mlir/include/mlir/Dialect/Affine/IR/AffineOps.td b/mlir/include/mlir/Dialect/Affine/IR/AffineOps.td --- a/mlir/include/mlir/Dialect/Affine/IR/AffineOps.td +++ b/mlir/include/mlir/Dialect/Affine/IR/AffineOps.td @@ -657,16 +657,16 @@ let builders = [ OpBuilder<"OpBuilder &builder, OperationState &result, " - "ArrayRef resultTypes, " + "TypeRange resultTypes, " "ArrayRef reductions, " "ArrayRef ranges">, OpBuilder<"OpBuilder &builder, OperationState &result, " - "ArrayRef resultTypes, " + "TypeRange resultTypes, " "ArrayRef reductions, " "AffineMap lbMap, ValueRange lbArgs, " "AffineMap ubMap, ValueRange ubArgs">, OpBuilder<"OpBuilder &builder, OperationState &result, " - "ArrayRef resultTypes, " + "TypeRange resultTypes, " "ArrayRef reductions, " "AffineMap lbMap, ValueRange lbArgs, " "AffineMap ubMap, ValueRange ubArgs, " diff --git a/mlir/include/mlir/Dialect/GPU/GPUOps.td b/mlir/include/mlir/Dialect/GPU/GPUOps.td --- a/mlir/include/mlir/Dialect/GPU/GPUOps.td +++ b/mlir/include/mlir/Dialect/GPU/GPUOps.td @@ -205,8 +205,8 @@ let builders = [ OpBuilder<"OpBuilder &builder, OperationState &result, StringRef name, " - "FunctionType type, ArrayRef workgroupAttributions = {}, " - "ArrayRef privateAttributions = {}, " + "FunctionType type, TypeRange workgroupAttributions = {}, " + "TypeRange privateAttributions = {}, " "ArrayRef attrs = {}"> ]; diff --git a/mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td b/mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td --- a/mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td +++ b/mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td @@ -383,7 +383,7 @@ AnySuccessor:$unwindDest); let builders = [OpBuilder< - "OpBuilder &b, OperationState &result, ArrayRef tys, " + "OpBuilder &b, OperationState &result, TypeRange tys, " "FlatSymbolRefAttr callee, ValueRange ops, Block* normal, " "ValueRange normalOps, Block* unwind, ValueRange unwindOps", [{ @@ -391,7 +391,7 @@ build(b, result, tys, ops, normal, normalOps, unwind, unwindOps); }]>, OpBuilder< - "OpBuilder &b, OperationState &result, ArrayRef tys, " + "OpBuilder &b, OperationState &result, TypeRange tys, " "ValueRange ops, Block* normal, " "ValueRange normalOps, Block* unwind, ValueRange unwindOps", [{ diff --git a/mlir/include/mlir/Dialect/Linalg/IR/LinalgStructuredOps.td b/mlir/include/mlir/Dialect/Linalg/IR/LinalgStructuredOps.td --- a/mlir/include/mlir/Dialect/Linalg/IR/LinalgStructuredOps.td +++ b/mlir/include/mlir/Dialect/Linalg/IR/LinalgStructuredOps.td @@ -644,7 +644,7 @@ let builders = [ OpBuilder< - "OpBuilder &builder, OperationState &result, ArrayRef resultTensorTypes," + "OpBuilder &builder, OperationState &result, TypeRange resultTensorTypes," "ValueRange inputs, ValueRange outputBuffers, ValueRange initTensors, " "ArrayRef indexingMaps, ArrayRef iteratorTypes, " "StringRef doc, StringRef libraryCall, IntegerAttr symbolSource, " @@ -656,7 +656,7 @@ "StringRef doc, StringRef libraryCall, IntegerAttr symbolSource, " "function_ref = nullptr">, OpBuilder< - "OpBuilder &builder, OperationState &result, ArrayRef resultTensorTypes," + "OpBuilder &builder, OperationState &result, TypeRange resultTensorTypes," "ValueRange inputs, ValueRange outputBuffers, ValueRange initTensors, " "ArrayRef indexingMaps, ArrayRef iteratorTypes, " "function_ref = nullptr">, @@ -823,7 +823,7 @@ let builders = [ OpBuilder< - "OpBuilder &builder, OperationState &result, ArrayRef resultTensorTypes," + "OpBuilder &builder, OperationState &result, TypeRange resultTensorTypes," "ValueRange inputs, ValueRange outputBuffers, ValueRange initTensors, " "ArrayRef indexingMaps, ArrayRef iteratorTypes, " "StringRef doc, StringRef libraryCall, IntegerAttr symbolSource, " @@ -835,7 +835,7 @@ "StringRef doc, StringRef libraryCall, IntegerAttr symbolSource, " "function_ref = nullptr">, OpBuilder< - "OpBuilder &builder, OperationState &result, ArrayRef resultTensorTypes," + "OpBuilder &builder, OperationState &result, TypeRange resultTensorTypes," "ValueRange inputs, ValueRange outputBuffers, ValueRange initTensors, " "ArrayRef indexingMaps, ArrayRef iteratorTypes, " "function_ref = nullptr">, diff --git a/mlir/include/mlir/Dialect/Linalg/IR/LinalgStructuredOpsInterface.td b/mlir/include/mlir/Dialect/Linalg/IR/LinalgStructuredOpsInterface.td --- a/mlir/include/mlir/Dialect/Linalg/IR/LinalgStructuredOpsInterface.td +++ b/mlir/include/mlir/Dialect/Linalg/IR/LinalgStructuredOpsInterface.td @@ -531,7 +531,7 @@ (ins "OpBuilder &":$builder, "Location":$loc, "ValueRange":$operands, "ArrayRef":$attributes), [{ - return builder.create(loc, ArrayRef{}, operands, + return builder.create(loc, TypeRange{}, operands, attributes); }] >, diff --git a/mlir/include/mlir/Dialect/StandardOps/IR/Ops.td b/mlir/include/mlir/Dialect/StandardOps/IR/Ops.td --- a/mlir/include/mlir/Dialect/StandardOps/IR/Ops.td +++ b/mlir/include/mlir/Dialect/StandardOps/IR/Ops.td @@ -721,13 +721,13 @@ result.addTypes(callee.getType().getResults()); }]>, OpBuilder< "OpBuilder &builder, OperationState &result, SymbolRefAttr callee," - "ArrayRef results, ValueRange operands = {}", [{ + "TypeRange results, ValueRange operands = {}", [{ result.addOperands(operands); result.addAttribute("callee", callee); result.addTypes(results); }]>, OpBuilder< "OpBuilder &builder, OperationState &result, StringRef callee," - "ArrayRef results, ValueRange operands = {}", [{ + "TypeRange results, ValueRange operands = {}", [{ build(builder, result, builder.getSymbolRefAttr(callee), results, operands); }]>]; @@ -2812,7 +2812,7 @@ let results = (outs AnyMemRef:$result); let builders = [ - // Build a SubViewOp with mized static and dynamic entries. + // Build a SubViewOp with mixed static and dynamic entries. OpBuilder< "OpBuilder &b, OperationState &result, Value source, " "ArrayRef staticOffsets, ArrayRef staticSizes," diff --git a/mlir/lib/Conversion/GPUToVulkan/ConvertGPULaunchFuncToVulkanLaunchFunc.cpp b/mlir/lib/Conversion/GPUToVulkan/ConvertGPULaunchFuncToVulkanLaunchFunc.cpp --- a/mlir/lib/Conversion/GPUToVulkan/ConvertGPULaunchFuncToVulkanLaunchFunc.cpp +++ b/mlir/lib/Conversion/GPUToVulkan/ConvertGPULaunchFuncToVulkanLaunchFunc.cpp @@ -173,7 +173,7 @@ // Create vulkan launch call op. auto vulkanLaunchCallOp = builder.create( - loc, ArrayRef{}, builder.getSymbolRefAttr(kVulkanLaunch), + loc, TypeRange{}, builder.getSymbolRefAttr(kVulkanLaunch), vulkanLaunchOperands); // Set SPIR-V binary shader data as an attribute. diff --git a/mlir/lib/Conversion/GPUToVulkan/ConvertLaunchFuncToVulkanCalls.cpp b/mlir/lib/Conversion/GPUToVulkan/ConvertLaunchFuncToVulkanCalls.cpp --- a/mlir/lib/Conversion/GPUToVulkan/ConvertLaunchFuncToVulkanCalls.cpp +++ b/mlir/lib/Conversion/GPUToVulkan/ConvertLaunchFuncToVulkanCalls.cpp @@ -247,11 +247,11 @@ } // Create call to `bindMemRef`. builder.create( - loc, ArrayRef{getVoidType()}, + loc, TypeRange{getVoidType()}, builder.getSymbolRefAttr( StringRef(symbolName.data(), symbolName.size())), - ArrayRef{vulkanRuntime, descriptorSet, descriptorBinding, - ptrToMemRefDescriptor}); + ValueRange{vulkanRuntime, descriptorSet, descriptorBinding, + ptrToMemRefDescriptor}); } } @@ -373,8 +373,8 @@ Location loc = cInterfaceVulkanLaunchCallOp.getLoc(); // Create call to `initVulkan`. auto initVulkanCall = builder.create( - loc, ArrayRef{getPointerType()}, - builder.getSymbolRefAttr(kInitVulkan), ArrayRef{}); + loc, TypeRange{getPointerType()}, builder.getSymbolRefAttr(kInitVulkan), + ValueRange{}); // The result of `initVulkan` function is a pointer to Vulkan runtime, we // need to pass that pointer to each Vulkan runtime call. auto vulkanRuntime = initVulkanCall.getResult(0); @@ -396,35 +396,34 @@ // Create call to `setBinaryShader` runtime function with the given pointer to // SPIR-V binary and binary size. builder.create( - loc, ArrayRef{getVoidType()}, - builder.getSymbolRefAttr(kSetBinaryShader), - ArrayRef{vulkanRuntime, ptrToSPIRVBinary, binarySize}); + loc, TypeRange{getVoidType()}, builder.getSymbolRefAttr(kSetBinaryShader), + ValueRange{vulkanRuntime, ptrToSPIRVBinary, binarySize}); // Create LLVM global with entry point name. Value entryPointName = createEntryPointNameConstant( spirvAttributes.second.getValue(), loc, builder); // Create call to `setEntryPoint` runtime function with the given pointer to // entry point name. - builder.create(loc, ArrayRef{getVoidType()}, + builder.create(loc, TypeRange{getVoidType()}, builder.getSymbolRefAttr(kSetEntryPoint), - ArrayRef{vulkanRuntime, entryPointName}); + ValueRange{vulkanRuntime, entryPointName}); // Create number of local workgroup for each dimension. builder.create( - loc, ArrayRef{getVoidType()}, + loc, TypeRange{getVoidType()}, builder.getSymbolRefAttr(kSetNumWorkGroups), - ArrayRef{vulkanRuntime, cInterfaceVulkanLaunchCallOp.getOperand(0), - cInterfaceVulkanLaunchCallOp.getOperand(1), - cInterfaceVulkanLaunchCallOp.getOperand(2)}); + ValueRange{vulkanRuntime, cInterfaceVulkanLaunchCallOp.getOperand(0), + cInterfaceVulkanLaunchCallOp.getOperand(1), + cInterfaceVulkanLaunchCallOp.getOperand(2)}); // Create call to `runOnVulkan` runtime function. - builder.create(loc, ArrayRef{getVoidType()}, + builder.create(loc, TypeRange{getVoidType()}, builder.getSymbolRefAttr(kRunOnVulkan), - ArrayRef{vulkanRuntime}); + ValueRange{vulkanRuntime}); // Create call to 'deinitVulkan' runtime function. - builder.create(loc, ArrayRef{getVoidType()}, + builder.create(loc, TypeRange{getVoidType()}, builder.getSymbolRefAttr(kDeinitVulkan), - ArrayRef{vulkanRuntime}); + ValueRange{vulkanRuntime}); // Declare runtime functions. declareVulkanFunctions(loc); diff --git a/mlir/lib/Conversion/LinalgToStandard/LinalgToStandard.cpp b/mlir/lib/Conversion/LinalgToStandard/LinalgToStandard.cpp --- a/mlir/lib/Conversion/LinalgToStandard/LinalgToStandard.cpp +++ b/mlir/lib/Conversion/LinalgToStandard/LinalgToStandard.cpp @@ -123,7 +123,7 @@ return failure(); rewriter.replaceOpWithNewOp( - op, libraryCallName.getValue(), ArrayRef{}, + op, libraryCallName.getValue(), TypeRange(), createTypeCanonicalizedMemRefOperands(rewriter, op.getLoc(), op.getOperands())); return success(); @@ -151,7 +151,7 @@ return failure(); rewriter.replaceOpWithNewOp( - op, libraryCallName.getValue(), ArrayRef{}, + op, libraryCallName.getValue(), TypeRange(), createTypeCanonicalizedMemRefOperands(rewriter, op.getLoc(), op.getOperands())); return success(); @@ -185,7 +185,7 @@ for (auto operand : op.getOperands()) operands.push_back(operand); rewriter.replaceOpWithNewOp( - op, libraryCallName.getValue(), ArrayRef{}, + op, libraryCallName.getValue(), TypeRange(), createTypeCanonicalizedMemRefOperands(rewriter, op.getLoc(), operands)); return success(); } diff --git a/mlir/lib/Conversion/OpenMPToLLVM/OpenMPToLLVM.cpp b/mlir/lib/Conversion/OpenMPToLLVM/OpenMPToLLVM.cpp --- a/mlir/lib/Conversion/OpenMPToLLVM/OpenMPToLLVM.cpp +++ b/mlir/lib/Conversion/OpenMPToLLVM/OpenMPToLLVM.cpp @@ -26,8 +26,8 @@ matchAndRewrite(Operation *op, ArrayRef operands, ConversionPatternRewriter &rewriter) const override { auto curOp = cast(op); - auto newOp = rewriter.create( - curOp.getLoc(), ArrayRef(), operands, curOp.getAttrs()); + auto newOp = rewriter.create(curOp.getLoc(), TypeRange(), + operands, curOp.getAttrs()); rewriter.inlineRegionBefore(curOp.region(), newOp.region(), newOp.region().end()); if (failed(rewriter.convertRegionTypes(&newOp.region(), typeConverter))) diff --git a/mlir/lib/Conversion/StandardToLLVM/StandardToLLVM.cpp b/mlir/lib/Conversion/StandardToLLVM/StandardToLLVM.cpp --- a/mlir/lib/Conversion/StandardToLLVM/StandardToLLVM.cpp +++ b/mlir/lib/Conversion/StandardToLLVM/StandardToLLVM.cpp @@ -2189,7 +2189,7 @@ op->getLoc(), getVoidPtrType(), memref.allocatedPtr(rewriter, op->getLoc())); rewriter.replaceOpWithNewOp( - op, ArrayRef(), rewriter.getSymbolRefAttr(freeFunc), casted); + op, TypeRange(), rewriter.getSymbolRefAttr(freeFunc), casted); return success(); } }; @@ -2714,13 +2714,13 @@ // If ReturnOp has 0 or 1 operand, create it and return immediately. if (numArguments == 0) { - rewriter.replaceOpWithNewOp( - op, ArrayRef(), ArrayRef(), op->getAttrs()); + rewriter.replaceOpWithNewOp(op, TypeRange(), ValueRange(), + op->getAttrs()); return success(); } if (numArguments == 1) { rewriter.replaceOpWithNewOp( - op, ArrayRef(), updatedOperands, op->getAttrs()); + op, TypeRange(), updatedOperands, op->getAttrs()); return success(); } @@ -2735,7 +2735,7 @@ op->getLoc(), packedType, packed, updatedOperands[i], rewriter.getI64ArrayAttr(i)); } - rewriter.replaceOpWithNewOp(op, ArrayRef(), packed, + rewriter.replaceOpWithNewOp(op, TypeRange(), packed, op->getAttrs()); return success(); } diff --git a/mlir/lib/Conversion/VectorToLLVM/ConvertVectorToLLVM.cpp b/mlir/lib/Conversion/VectorToLLVM/ConvertVectorToLLVM.cpp --- a/mlir/lib/Conversion/VectorToLLVM/ConvertVectorToLLVM.cpp +++ b/mlir/lib/Conversion/VectorToLLVM/ConvertVectorToLLVM.cpp @@ -1382,7 +1382,7 @@ // Helper to emit a call. static void emitCall(ConversionPatternRewriter &rewriter, Location loc, Operation *ref, ValueRange params = ValueRange()) { - rewriter.create(loc, ArrayRef{}, + rewriter.create(loc, TypeRange(), rewriter.getSymbolRefAttr(ref), params); } diff --git a/mlir/lib/Dialect/Affine/IR/AffineOps.cpp b/mlir/lib/Dialect/Affine/IR/AffineOps.cpp --- a/mlir/lib/Dialect/Affine/IR/AffineOps.cpp +++ b/mlir/lib/Dialect/Affine/IR/AffineOps.cpp @@ -2460,7 +2460,7 @@ //===----------------------------------------------------------------------===// void AffineParallelOp::build(OpBuilder &builder, OperationState &result, - ArrayRef resultTypes, + TypeRange resultTypes, ArrayRef reductions, ArrayRef ranges) { SmallVector lbExprs(ranges.size(), @@ -2475,7 +2475,7 @@ } void AffineParallelOp::build(OpBuilder &builder, OperationState &result, - ArrayRef resultTypes, + TypeRange resultTypes, ArrayRef reductions, AffineMap lbMap, ValueRange lbArgs, AffineMap ubMap, ValueRange ubArgs) { @@ -2490,7 +2490,7 @@ } void AffineParallelOp::build(OpBuilder &builder, OperationState &result, - ArrayRef resultTypes, + TypeRange resultTypes, ArrayRef reductions, AffineMap lbMap, ValueRange lbArgs, AffineMap ubMap, ValueRange ubArgs, diff --git a/mlir/lib/Dialect/GPU/IR/GPUDialect.cpp b/mlir/lib/Dialect/GPU/IR/GPUDialect.cpp --- a/mlir/lib/Dialect/GPU/IR/GPUDialect.cpp +++ b/mlir/lib/Dialect/GPU/IR/GPUDialect.cpp @@ -475,8 +475,8 @@ void GPUFuncOp::build(OpBuilder &builder, OperationState &result, StringRef name, FunctionType type, - ArrayRef workgroupAttributions, - ArrayRef privateAttributions, + TypeRange workgroupAttributions, + TypeRange privateAttributions, ArrayRef attrs) { result.addAttribute(SymbolTable::getSymbolAttrName(), builder.getStringAttr(name)); diff --git a/mlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp b/mlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp --- a/mlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp +++ b/mlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp @@ -247,7 +247,7 @@ Value addr, unsigned alignment, bool isVolatile, bool isNonTemporal) { result.addOperands({value, addr}); - result.addTypes(ArrayRef{}); + result.addTypes({}); if (isVolatile) result.addAttribute(kVolatileAttrName, builder.getUnitAttr()); if (isNonTemporal) @@ -1787,7 +1787,7 @@ loc, LLVM::LLVMType::getInt64Ty(ctx), builder.getIntegerAttr(builder.getIndexType(), 0)); return builder.create(loc, LLVM::LLVMType::getInt8PtrTy(ctx), - globalPtr, ArrayRef({cst0, cst0})); + globalPtr, ValueRange{cst0, cst0}); } bool mlir::LLVM::satisfiesLLVMModule(Operation *op) { diff --git a/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp b/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp --- a/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp +++ b/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp @@ -99,7 +99,7 @@ //===----------------------------------------------------------------------===// void GenericOp::build( OpBuilder &builder, OperationState &result, - ArrayRef resultTensorTypes, ValueRange inputs, + TypeRange resultTensorTypes, ValueRange inputs, ValueRange outputBuffers, ValueRange initTensors, ArrayRef indexingMaps, ArrayRef iteratorTypes, StringRef doc, StringRef libraryCall, IntegerAttr symbolSource, @@ -130,7 +130,7 @@ ArrayRef iteratorTypes, StringRef doc, StringRef libraryCall, IntegerAttr symbolSource, function_ref bodyBuild) { - build(builder, result, ArrayRef{}, inputs, outputBuffers, ValueRange{}, + build(builder, result, TypeRange{}, inputs, outputBuffers, ValueRange{}, indexingMaps, iteratorTypes, doc, libraryCall, symbolSource, bodyBuild); } @@ -147,7 +147,7 @@ void GenericOp::build( OpBuilder &builder, OperationState &result, - ArrayRef resultTensorTypes, ValueRange inputs, + TypeRange resultTensorTypes, ValueRange inputs, ValueRange outputBuffers, ValueRange initTensors, ArrayRef indexingMaps, ArrayRef iteratorTypes, function_ref bodyBuild) { @@ -160,7 +160,7 @@ void IndexedGenericOp::build( OpBuilder &builder, OperationState &result, - ArrayRef resultTensorTypes, ValueRange inputs, + TypeRange resultTensorTypes, ValueRange inputs, ValueRange outputBuffers, ValueRange initTensors, ArrayRef indexingMaps, ArrayRef iteratorTypes, StringRef doc, StringRef libraryCall, IntegerAttr symbolSource, @@ -196,7 +196,7 @@ IntegerAttr symbolSource, function_ref bodyBuild) { - build(builder, result, ArrayRef{}, inputs, outputBuffers, ValueRange{}, + build(builder, result, TypeRange{}, inputs, outputBuffers, ValueRange{}, indexingMaps, iteratorTypes, doc, libraryCall, symbolSource, bodyBuild); } @@ -214,7 +214,7 @@ void IndexedGenericOp::build( OpBuilder &builder, OperationState &result, - ArrayRef resultTensorTypes, ValueRange inputs, + TypeRange resultTensorTypes, ValueRange inputs, ValueRange outputBuffers, ValueRange initTensors, ArrayRef indexingMaps, ArrayRef iteratorTypes, function_ref diff --git a/mlir/test/lib/Dialect/Test/TestDialect.cpp b/mlir/test/lib/Dialect/Test/TestDialect.cpp --- a/mlir/test/lib/Dialect/Test/TestDialect.cpp +++ b/mlir/test/lib/Dialect/Test/TestDialect.cpp @@ -255,7 +255,7 @@ LogicalResult matchAndRewrite(FoldToCallOp op, PatternRewriter &rewriter) const override { - rewriter.replaceOpWithNewOp(op, ArrayRef(), op.calleeAttr(), + rewriter.replaceOpWithNewOp(op, TypeRange(), op.calleeAttr(), ValueRange()); return success(); } diff --git a/mlir/unittests/TableGen/OpBuildGen.cpp b/mlir/unittests/TableGen/OpBuildGen.cpp --- a/mlir/unittests/TableGen/OpBuildGen.cpp +++ b/mlir/unittests/TableGen/OpBuildGen.cpp @@ -73,20 +73,20 @@ template void testSingleVariadicInputInferredType() { // Test separate arg, separate param build method. - auto op = builder.create(loc, i32Ty, ArrayRef{cstI32, cstI32}); + auto op = builder.create(loc, i32Ty, ValueRange{cstI32, cstI32}); verifyOp(std::move(op), {i32Ty}, {cstI32, cstI32}, noAttrs); // Test collective params build method. - op = builder.create(loc, ArrayRef{i32Ty}, - ArrayRef{cstI32, cstI32}); + op = + builder.create(loc, TypeRange{i32Ty}, ValueRange{cstI32, cstI32}); verifyOp(std::move(op), {i32Ty}, {cstI32, cstI32}, noAttrs); // Test build method with no result types, default value of attributes. - op = builder.create(loc, ArrayRef{cstI32, cstI32}); + op = builder.create(loc, ValueRange{cstI32, cstI32}); verifyOp(std::move(op), {i32Ty}, {cstI32, cstI32}, noAttrs); // Test build method with no result types and supplied attributes. - op = builder.create(loc, ArrayRef{cstI32, cstI32}, attrs); + op = builder.create(loc, ValueRange{cstI32, cstI32}, attrs); verifyOp(std::move(op), {i32Ty}, {cstI32, cstI32}, attrs); } @@ -111,17 +111,17 @@ verifyOp(op, {i32Ty}, {cstI32}, noAttrs); // Test separate args, collective results build method. - op = builder.create(loc, ArrayRef{i32Ty}, cstI32); + op = builder.create(loc, TypeRange{i32Ty}, cstI32); verifyOp(op, {i32Ty}, {cstI32}, noAttrs); // Test collective args, collective params build method. - op = builder.create(loc, ArrayRef{i32Ty}, - ArrayRef{cstI32}); + op = builder.create(loc, TypeRange{i32Ty}, + ValueRange{cstI32}); verifyOp(op, {i32Ty}, {cstI32}, noAttrs); // Test collective args, collective results, non-empty attributes - op = builder.create(loc, ArrayRef{i32Ty}, - ArrayRef{cstI32}, attrs); + op = builder.create(loc, TypeRange{i32Ty}, + ValueRange{cstI32}, attrs); verifyOp(op, {i32Ty}, {cstI32}, attrs); } @@ -138,25 +138,25 @@ /// variadic result. TEST_F(OpBuildGenTest, BuildMethodsSingleVariadicArgAndResult) { // Test collective args, collective results method, building a unary op. - auto op = builder.create(loc, ArrayRef{i32Ty}, - ArrayRef{cstI32}); + auto op = builder.create(loc, TypeRange{i32Ty}, + ValueRange{cstI32}); verifyOp(std::move(op), {i32Ty}, {cstI32}, noAttrs); // Test collective args, collective results method, building a unary op with // named attributes. - op = builder.create(loc, ArrayRef{i32Ty}, - ArrayRef{cstI32}, attrs); + op = builder.create(loc, TypeRange{i32Ty}, + ValueRange{cstI32}, attrs); verifyOp(std::move(op), {i32Ty}, {cstI32}, attrs); // Test collective args, collective results method, building a binary op. - op = builder.create(loc, ArrayRef{i32Ty, f32Ty}, - ArrayRef{cstI32, cstF32}); + op = builder.create(loc, TypeRange{i32Ty, f32Ty}, + ValueRange{cstI32, cstF32}); verifyOp(std::move(op), {i32Ty, f32Ty}, {cstI32, cstF32}, noAttrs); // Test collective args, collective results method, building a binary op with // named attributes. - op = builder.create(loc, ArrayRef{i32Ty, f32Ty}, - ArrayRef{cstI32, cstF32}, attrs); + op = builder.create(loc, TypeRange{i32Ty, f32Ty}, + ValueRange{cstI32, cstF32}, attrs); verifyOp(std::move(op), {i32Ty, f32Ty}, {cstI32, cstF32}, attrs); } @@ -164,23 +164,22 @@ /// result. TEST_F(OpBuildGenTest, BuildMethodsSingleVariadicArgNonVariadicResults) { // Test separate arg, separate param build method. - auto op = - builder.create(loc, i32Ty, ArrayRef{cstI32}); + auto op = builder.create(loc, i32Ty, ValueRange{cstI32}); verifyOp(std::move(op), {i32Ty}, {cstI32}, noAttrs); // Test collective params build method, no attributes. - op = builder.create(loc, ArrayRef{i32Ty}, - ArrayRef{cstI32}); + op = builder.create(loc, TypeRange{i32Ty}, + ValueRange{cstI32}); verifyOp(std::move(op), {i32Ty}, {cstI32}, noAttrs); // Test collective params build method no attributes, 2 inputs. - op = builder.create(loc, ArrayRef{i32Ty}, - ArrayRef{cstI32, cstF32}); + op = builder.create(loc, TypeRange{i32Ty}, + ValueRange{cstI32, cstF32}); verifyOp(std::move(op), {i32Ty}, {cstI32, cstF32}, noAttrs); // Test collective params build method, non-empty attributes. - op = builder.create(loc, ArrayRef{i32Ty}, - ArrayRef{cstI32, cstF32}, attrs); + op = builder.create(loc, TypeRange{i32Ty}, + ValueRange{cstI32, cstF32}, attrs); verifyOp(std::move(op), {i32Ty}, {cstI32, cstF32}, attrs); } @@ -189,19 +188,18 @@ TEST_F(OpBuildGenTest, BuildMethodsSingleVariadicArgAndMultipleVariadicResults) { // Test separate arg, separate param build method. - auto op = builder.create(loc, ArrayRef{i32Ty}, - ArrayRef{f32Ty}, - ArrayRef{cstI32}); + auto op = builder.create( + loc, TypeRange{i32Ty}, TypeRange{f32Ty}, ValueRange{cstI32}); verifyOp(std::move(op), {i32Ty, f32Ty}, {cstI32}, noAttrs); // Test collective params build method, no attributes. - op = builder.create(loc, ArrayRef{i32Ty, f32Ty}, - ArrayRef{cstI32}); + op = builder.create(loc, TypeRange{i32Ty, f32Ty}, + ValueRange{cstI32}); verifyOp(std::move(op), {i32Ty, f32Ty}, {cstI32}, noAttrs); // Test collective params build method, with attributes. - op = builder.create(loc, ArrayRef{i32Ty, f32Ty}, - ArrayRef{cstI32}, attrs); + op = builder.create(loc, TypeRange{i32Ty, f32Ty}, + ValueRange{cstI32}, attrs); verifyOp(std::move(op), {i32Ty, f32Ty}, {cstI32}, attrs); }