[mlir] update affine+arith create APIs (1/n)#149656
Conversation
d3556c9 to
56146a5
Compare
|
@llvm/pr-subscribers-mlir-arith @llvm/pr-subscribers-mlir Author: Maksim Levental (makslevental) ChangesThis PR updates create APIs for arith and affine - specifically these are the only in-tree dialects/ops with "custom" builders: Every "update" PR after this one will be a simple regex. See #147168 for more info. Patch is 28.13 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/149656.diff 4 Files Affected:
diff --git a/mlir/include/mlir/Dialect/Affine/IR/AffineOps.h b/mlir/include/mlir/Dialect/Affine/IR/AffineOps.h
index 2091faa6b0b02..333de6bbd8a05 100644
--- a/mlir/include/mlir/Dialect/Affine/IR/AffineOps.h
+++ b/mlir/include/mlir/Dialect/Affine/IR/AffineOps.h
@@ -114,6 +114,21 @@ class AffineDmaStartOp
AffineMap tagMap, ValueRange tagIndices, Value numElements,
Value stride = nullptr, Value elementsPerStride = nullptr);
+ static AffineDmaStartOp
+ create(OpBuilder &builder, Location location, Value srcMemRef,
+ AffineMap srcMap, ValueRange srcIndices, Value destMemRef,
+ AffineMap dstMap, ValueRange destIndices, Value tagMemRef,
+ AffineMap tagMap, ValueRange tagIndices, Value numElements,
+ Value stride = nullptr, Value elementsPerStride = nullptr);
+
+ static AffineDmaStartOp create(ImplicitLocOpBuilder &builder, Value srcMemRef,
+ AffineMap srcMap, ValueRange srcIndices,
+ Value destMemRef, AffineMap dstMap,
+ ValueRange destIndices, Value tagMemRef,
+ AffineMap tagMap, ValueRange tagIndices,
+ Value numElements, Value stride = nullptr,
+ Value elementsPerStride = nullptr);
+
/// Returns the operand index of the source memref.
unsigned getSrcMemRefOperandIndex() { return 0; }
@@ -319,6 +334,12 @@ class AffineDmaWaitOp
static void build(OpBuilder &builder, OperationState &result, Value tagMemRef,
AffineMap tagMap, ValueRange tagIndices, Value numElements);
+ static AffineDmaWaitOp create(OpBuilder &builder, Location location,
+ Value tagMemRef, AffineMap tagMap,
+ ValueRange tagIndices, Value numElements);
+ static AffineDmaWaitOp create(ImplicitLocOpBuilder &builder, Value tagMemRef,
+ AffineMap tagMap, ValueRange tagIndices,
+ Value numElements);
static StringRef getOperationName() { return "affine.dma_wait"; }
diff --git a/mlir/include/mlir/Dialect/Arith/IR/Arith.h b/mlir/include/mlir/Dialect/Arith/IR/Arith.h
index 7c50c2036ffdc..0fc3db8e993d8 100644
--- a/mlir/include/mlir/Dialect/Arith/IR/Arith.h
+++ b/mlir/include/mlir/Dialect/Arith/IR/Arith.h
@@ -59,15 +59,27 @@ class ConstantIntOp : public arith::ConstantOp {
/// Build a constant int op that produces an integer of the specified width.
static void build(OpBuilder &builder, OperationState &result, int64_t value,
unsigned width);
+ static ConstantIntOp create(OpBuilder &builder, Location location,
+ int64_t value, unsigned width);
+ static ConstantIntOp create(ImplicitLocOpBuilder &builder, int64_t value,
+ unsigned width);
/// Build a constant int op that produces an integer of the specified type,
/// which must be an integer type.
static void build(OpBuilder &builder, OperationState &result, Type type,
int64_t value);
+ static ConstantIntOp create(OpBuilder &builder, Location location, Type type,
+ int64_t value);
+ static ConstantIntOp create(ImplicitLocOpBuilder &builder, Type type,
+ int64_t value);
/// Build a constant int op that produces an integer from an APInt
static void build(OpBuilder &builder, OperationState &result, Type type,
const APInt &value);
+ static ConstantIntOp create(OpBuilder &builder, Location location, Type type,
+ const APInt &value);
+ static ConstantIntOp create(ImplicitLocOpBuilder &builder, Type type,
+ const APInt &value);
inline int64_t value() {
return cast<IntegerAttr>(arith::ConstantOp::getValue()).getInt();
@@ -85,6 +97,10 @@ class ConstantFloatOp : public arith::ConstantOp {
/// Build a constant float op that produces a float of the specified type.
static void build(OpBuilder &builder, OperationState &result, FloatType type,
const APFloat &value);
+ static ConstantFloatOp create(OpBuilder &builder, Location location,
+ FloatType type, const APFloat &value);
+ static ConstantFloatOp create(ImplicitLocOpBuilder &builder, FloatType type,
+ const APFloat &value);
inline APFloat value() {
return cast<FloatAttr>(arith::ConstantOp::getValue()).getValue();
@@ -100,6 +116,9 @@ class ConstantIndexOp : public arith::ConstantOp {
static ::mlir::TypeID resolveTypeID() { return TypeID::get<ConstantOp>(); }
/// Build a constant int op that produces an index.
static void build(OpBuilder &builder, OperationState &result, int64_t value);
+ static ConstantIndexOp create(OpBuilder &builder, Location location,
+ int64_t value);
+ static ConstantIndexOp create(ImplicitLocOpBuilder &builder, int64_t value);
inline int64_t value() {
return cast<IntegerAttr>(arith::ConstantOp::getValue()).getInt();
diff --git a/mlir/lib/Dialect/Affine/IR/AffineOps.cpp b/mlir/lib/Dialect/Affine/IR/AffineOps.cpp
index e8e8f624d806e..bd1be7c087d05 100644
--- a/mlir/lib/Dialect/Affine/IR/AffineOps.cpp
+++ b/mlir/lib/Dialect/Affine/IR/AffineOps.cpp
@@ -240,7 +240,7 @@ Operation *AffineDialect::materializeConstant(OpBuilder &builder,
Attribute value, Type type,
Location loc) {
if (auto poison = dyn_cast<ub::PoisonAttr>(value))
- return builder.create<ub::PoisonOp>(loc, type, poison);
+ return ub::PoisonOp::create(builder, loc, type, poison);
return arith::ConstantOp::materialize(builder, value, type, loc);
}
@@ -1282,7 +1282,7 @@ mlir::affine::makeComposedAffineApply(OpBuilder &b, Location loc, AffineMap map,
map = foldAttributesIntoMap(b, map, operands, valueOperands);
composeAffineMapAndOperands(&map, &valueOperands, composeAffineMin);
assert(map);
- return b.create<AffineApplyOp>(loc, map, valueOperands);
+ return AffineApplyOp::create(b, loc, map, valueOperands);
}
AffineApplyOp
@@ -1389,7 +1389,7 @@ static OpTy makeComposedMinMax(OpBuilder &b, Location loc, AffineMap map,
SmallVector<Value> valueOperands;
map = foldAttributesIntoMap(b, map, operands, valueOperands);
composeMultiResultAffineMap(map, valueOperands);
- return b.create<OpTy>(loc, b.getIndexType(), map, valueOperands);
+ return OpTy::create(b, loc, b.getIndexType(), map, valueOperands);
}
AffineMinOp
@@ -1747,6 +1747,32 @@ void AffineDmaStartOp::build(OpBuilder &builder, OperationState &result,
}
}
+AffineDmaStartOp AffineDmaStartOp::create(
+ OpBuilder &builder, Location location, Value srcMemRef, AffineMap srcMap,
+ ValueRange srcIndices, Value destMemRef, AffineMap dstMap,
+ ValueRange destIndices, Value tagMemRef, AffineMap tagMap,
+ ValueRange tagIndices, Value numElements, Value stride,
+ Value elementsPerStride) {
+ mlir::OperationState state(location, getOperationName());
+ build(builder, state, srcMemRef, srcMap, srcIndices, destMemRef, dstMap,
+ destIndices, tagMemRef, tagMap, tagIndices, numElements, stride,
+ elementsPerStride);
+ auto result = llvm::dyn_cast<AffineDmaStartOp>(builder.create(state));
+ assert(result && "builder didn't return the right type");
+ return result;
+}
+
+AffineDmaStartOp AffineDmaStartOp::create(
+ ImplicitLocOpBuilder &builder, Value srcMemRef, AffineMap srcMap,
+ ValueRange srcIndices, Value destMemRef, AffineMap dstMap,
+ ValueRange destIndices, Value tagMemRef, AffineMap tagMap,
+ ValueRange tagIndices, Value numElements, Value stride,
+ Value elementsPerStride) {
+ return create(builder, builder.getLoc(), srcMemRef, srcMap, srcIndices,
+ destMemRef, dstMap, destIndices, tagMemRef, tagMap, tagIndices,
+ numElements, stride, elementsPerStride);
+}
+
void AffineDmaStartOp::print(OpAsmPrinter &p) {
p << " " << getSrcMemRef() << '[';
p.printAffineMapOfSSAIds(getSrcMapAttr(), getSrcIndices());
@@ -1917,6 +1943,25 @@ void AffineDmaWaitOp::build(OpBuilder &builder, OperationState &result,
result.addOperands(numElements);
}
+AffineDmaWaitOp AffineDmaWaitOp::create(OpBuilder &builder, Location location,
+ Value tagMemRef, AffineMap tagMap,
+ ValueRange tagIndices,
+ Value numElements) {
+ mlir::OperationState state(location, getOperationName());
+ build(builder, state, tagMemRef, tagMap, tagIndices, numElements);
+ auto result = llvm::dyn_cast<AffineDmaWaitOp>(builder.create(state));
+ assert(result && "builder didn't return the right type");
+ return result;
+}
+
+AffineDmaWaitOp AffineDmaWaitOp::create(ImplicitLocOpBuilder &builder,
+ Value tagMemRef, AffineMap tagMap,
+ ValueRange tagIndices,
+ Value numElements) {
+ return create(builder, builder.getLoc(), tagMemRef, tagMap, tagIndices,
+ numElements);
+}
+
void AffineDmaWaitOp::print(OpAsmPrinter &p) {
p << " " << getTagMemRef() << '[';
SmallVector<Value, 2> operands(getTagIndices());
@@ -2688,8 +2733,8 @@ FailureOr<LoopLikeOpInterface> AffineForOp::replaceWithAdditionalYields(
rewriter.setInsertionPoint(getOperation());
auto inits = llvm::to_vector(getInits());
inits.append(newInitOperands.begin(), newInitOperands.end());
- AffineForOp newLoop = rewriter.create<AffineForOp>(
- getLoc(), getLowerBoundOperands(), getLowerBoundMap(),
+ AffineForOp newLoop = AffineForOp::create(
+ rewriter, getLoc(), getLowerBoundOperands(), getLowerBoundMap(),
getUpperBoundOperands(), getUpperBoundMap(), getStepAsInt(), inits);
// Generate the new yield values and append them to the scf.yield operation.
@@ -2831,7 +2876,7 @@ static void buildAffineLoopNestImpl(
OpBuilder::InsertionGuard nestedGuard(nestedBuilder);
bodyBuilderFn(nestedBuilder, nestedLoc, ivs);
}
- nestedBuilder.create<AffineYieldOp>(nestedLoc);
+ AffineYieldOp::create(nestedBuilder, nestedLoc);
};
// Delegate actual loop creation to the callback in order to dispatch
@@ -2846,8 +2891,8 @@ static AffineForOp
buildAffineLoopFromConstants(OpBuilder &builder, Location loc, int64_t lb,
int64_t ub, int64_t step,
AffineForOp::BodyBuilderFn bodyBuilderFn) {
- return builder.create<AffineForOp>(loc, lb, ub, step,
- /*iterArgs=*/ValueRange(), bodyBuilderFn);
+ return AffineForOp::create(builder, loc, lb, ub, step,
+ /*iterArgs=*/ValueRange(), bodyBuilderFn);
}
/// Creates an affine loop from the bounds that may or may not be constants.
@@ -2860,9 +2905,9 @@ buildAffineLoopFromValues(OpBuilder &builder, Location loc, Value lb, Value ub,
if (lbConst && ubConst)
return buildAffineLoopFromConstants(builder, loc, lbConst.value(),
ubConst.value(), step, bodyBuilderFn);
- return builder.create<AffineForOp>(loc, lb, builder.getDimIdentityMap(), ub,
- builder.getDimIdentityMap(), step,
- /*iterArgs=*/ValueRange(), bodyBuilderFn);
+ return AffineForOp::create(builder, loc, lb, builder.getDimIdentityMap(), ub,
+ builder.getDimIdentityMap(), step,
+ /*iterArgs=*/ValueRange(), bodyBuilderFn);
}
void mlir::affine::buildAffineLoopNest(
@@ -4883,7 +4928,7 @@ struct DropUnitExtentBasis
Location loc = delinearizeOp->getLoc();
auto getZero = [&]() -> Value {
if (!zero)
- zero = rewriter.create<arith::ConstantIndexOp>(loc, 0);
+ zero = arith::ConstantIndexOp::create(rewriter, loc, 0);
return zero.value();
};
@@ -4906,8 +4951,8 @@ struct DropUnitExtentBasis
if (!newBasis.empty()) {
// Will drop the leading nullptr from `basis` if there was no outer bound.
- auto newDelinearizeOp = rewriter.create<affine::AffineDelinearizeIndexOp>(
- loc, delinearizeOp.getLinearIndex(), newBasis);
+ auto newDelinearizeOp = affine::AffineDelinearizeIndexOp::create(
+ rewriter, loc, delinearizeOp.getLinearIndex(), newBasis);
int newIndex = 0;
// Map back the new delinearized indices to the values they replace.
for (auto &replacement : replacements) {
@@ -4971,12 +5016,12 @@ struct CancelDelinearizeOfLinearizeDisjointExactTail
return success();
}
- Value newLinearize = rewriter.create<affine::AffineLinearizeIndexOp>(
- linearizeOp.getLoc(), linearizeIns.drop_back(numMatches),
+ Value newLinearize = affine::AffineLinearizeIndexOp::create(
+ rewriter, linearizeOp.getLoc(), linearizeIns.drop_back(numMatches),
ArrayRef<OpFoldResult>{linearizeBasis}.drop_back(numMatches),
linearizeOp.getDisjoint());
- auto newDelinearize = rewriter.create<affine::AffineDelinearizeIndexOp>(
- delinearizeOp.getLoc(), newLinearize,
+ auto newDelinearize = affine::AffineDelinearizeIndexOp::create(
+ rewriter, delinearizeOp.getLoc(), newLinearize,
ArrayRef<OpFoldResult>{delinearizeBasis}.drop_back(numMatches),
delinearizeOp.hasOuterBound());
SmallVector<Value> mergedResults(newDelinearize.getResults());
@@ -5048,19 +5093,16 @@ struct SplitDelinearizeSpanningLastLinearizeArg final
delinearizeOp,
"need at least two elements to form the basis product");
- Value linearizeWithoutBack =
- rewriter.create<affine::AffineLinearizeIndexOp>(
- linearizeOp.getLoc(), linearizeOp.getMultiIndex().drop_back(),
- linearizeOp.getDynamicBasis(),
- linearizeOp.getStaticBasis().drop_back(),
- linearizeOp.getDisjoint());
- auto delinearizeWithoutSplitPart =
- rewriter.create<affine::AffineDelinearizeIndexOp>(
- delinearizeOp.getLoc(), linearizeWithoutBack,
- delinearizeOp.getDynamicBasis(), basis.drop_back(elemsToSplit),
- delinearizeOp.hasOuterBound());
- auto delinearizeBack = rewriter.create<affine::AffineDelinearizeIndexOp>(
- delinearizeOp.getLoc(), linearizeOp.getMultiIndex().back(),
+ Value linearizeWithoutBack = affine::AffineLinearizeIndexOp::create(
+ rewriter, linearizeOp.getLoc(), linearizeOp.getMultiIndex().drop_back(),
+ linearizeOp.getDynamicBasis(), linearizeOp.getStaticBasis().drop_back(),
+ linearizeOp.getDisjoint());
+ auto delinearizeWithoutSplitPart = affine::AffineDelinearizeIndexOp::create(
+ rewriter, delinearizeOp.getLoc(), linearizeWithoutBack,
+ delinearizeOp.getDynamicBasis(), basis.drop_back(elemsToSplit),
+ delinearizeOp.hasOuterBound());
+ auto delinearizeBack = affine::AffineDelinearizeIndexOp::create(
+ rewriter, delinearizeOp.getLoc(), linearizeOp.getMultiIndex().back(),
basis.take_back(elemsToSplit), /*hasOuterBound=*/true);
SmallVector<Value> results = llvm::to_vector(
llvm::concat<Value>(delinearizeWithoutSplitPart.getResults(),
@@ -5272,7 +5314,7 @@ OpFoldResult computeProduct(Location loc, OpBuilder &builder,
}
if (auto constant = dyn_cast<AffineConstantExpr>(result))
return getAsIndexOpFoldResult(builder.getContext(), constant.getValue());
- return builder.create<AffineApplyOp>(loc, result, dynamicPart).getResult();
+ return AffineApplyOp::create(builder, loc, result, dynamicPart).getResult();
}
/// If conseceutive outputs of a delinearize_index are linearized with the same
@@ -5437,16 +5479,16 @@ struct CancelLinearizeOfDelinearizePortion final
newDelinBasis.erase(newDelinBasis.begin() + m.delinStart,
newDelinBasis.begin() + m.delinStart + m.length);
newDelinBasis.insert(newDelinBasis.begin() + m.delinStart, newSize);
- auto newDelinearize = rewriter.create<AffineDelinearizeIndexOp>(
- m.delinearize.getLoc(), m.delinearize.getLinearIndex(),
+ auto newDelinearize = AffineDelinearizeIndexOp::create(
+ rewriter, m.delinearize.getLoc(), m.delinearize.getLinearIndex(),
newDelinBasis);
// Since there may be other uses of the indices we just merged together,
// create a residual affine.delinearize_index that delinearizes the
// merged output into its component parts.
Value combinedElem = newDelinearize.getResult(m.delinStart);
- auto residualDelinearize = rewriter.create<AffineDelinearizeIndexOp>(
- m.delinearize.getLoc(), combinedElem, basisToMerge);
+ auto residualDelinearize = AffineDelinearizeIndexOp::create(
+ rewriter, m.delinearize.getLoc(), combinedElem, basisToMerge);
// Swap all the uses of the unaffected delinearize outputs to the new
// delinearization so that the old code can be removed if this
diff --git a/mlir/lib/Dialect/Arith/IR/ArithOps.cpp b/mlir/lib/Dialect/Arith/IR/ArithOps.cpp
index 4e40d4ebda004..ac00917d33a85 100644
--- a/mlir/lib/Dialect/Arith/IR/ArithOps.cpp
+++ b/mlir/lib/Dialect/Arith/IR/ArithOps.cpp
@@ -242,7 +242,7 @@ bool arith::ConstantOp::isBuildableWith(Attribute value, Type type) {
ConstantOp arith::ConstantOp::materialize(OpBuilder &builder, Attribute value,
Type type, Location loc) {
if (isBuildableWith(value, type))
- return builder.create<arith::ConstantOp>(loc, cast<TypedAttr>(value));
+ return arith::ConstantOp::create(builder, loc, cast<TypedAttr>(value));
return nullptr;
}
@@ -255,18 +255,66 @@ void arith::ConstantIntOp::build(OpBuilder &builder, OperationState &result,
builder.getIntegerAttr(type, value));
}
+arith::ConstantIntOp arith::ConstantIntOp::create(OpBuilder &builder,
+ Location location,
+ int64_t value,
+ unsigned width) {
+ mlir::OperationState state(location, getOperationName());
+ build(builder, state, value, width);
+ auto result = llvm::dyn_cast<ConstantIntOp>(builder.create(state));
+ assert(result && "builder didn't return the right type");
+ return result;
+}
+
+arith::ConstantIntOp arith::ConstantIntOp::create(ImplicitLocOpBuilder &builder,
+ int64_t value,
+ unsigned width) {
+ return create(builder, builder.getLoc(), value, width);
+}
+
void arith::ConstantIntOp::build(OpBuilder &builder, OperationState &result,
Type type, int64_t value) {
arith::ConstantOp::build(builder, result, type,
builder.getIntegerAttr(type, value));
}
+arith::ConstantIntOp arith::ConstantIntOp::create(OpBuilder &builder,
+ Location location, Type type,
+ int64_t value) {
+ mlir::OperationState state(location, getOperationName());
+ build(builder, state, type, value);
+ auto result = llvm::dyn_cast<ConstantIntOp>(builder.create(state));
+ assert(result && "builder didn't return the right type");
+ return result;
+}
+
+arith::ConstantIntOp arith::ConstantIntOp::create(ImplicitLocOpBuilder &builder,
+ Type type, int64_t value) {
+ return create(builder, builder.getLoc(), type, value);
+}
+
void arith::ConstantIntOp::build(OpBuilder &builder, OperationState &result,
Type type, const APInt &value) {
arith::ConstantOp::build(builder, result, type,
builder.getIntegerAttr(type, value));
}
+arith::ConstantIntOp arith::ConstantIntOp::create(OpBuilder &builder,
+ Location location, Type type,
+ const APInt &value) {
+ mlir::OperationState state(loc...
[truncated]
|
|
@llvm/pr-subscribers-mlir-affine Author: Maksim Levental (makslevental) ChangesThis PR updates create APIs for arith and affine - specifically these are the only in-tree dialects/ops with "custom" builders: Every "update" PR after this one will be a simple regex. See #147168 for more info. Patch is 28.13 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/149656.diff 4 Files Affected:
diff --git a/mlir/include/mlir/Dialect/Affine/IR/AffineOps.h b/mlir/include/mlir/Dialect/Affine/IR/AffineOps.h
index 2091faa6b0b02..333de6bbd8a05 100644
--- a/mlir/include/mlir/Dialect/Affine/IR/AffineOps.h
+++ b/mlir/include/mlir/Dialect/Affine/IR/AffineOps.h
@@ -114,6 +114,21 @@ class AffineDmaStartOp
AffineMap tagMap, ValueRange tagIndices, Value numElements,
Value stride = nullptr, Value elementsPerStride = nullptr);
+ static AffineDmaStartOp
+ create(OpBuilder &builder, Location location, Value srcMemRef,
+ AffineMap srcMap, ValueRange srcIndices, Value destMemRef,
+ AffineMap dstMap, ValueRange destIndices, Value tagMemRef,
+ AffineMap tagMap, ValueRange tagIndices, Value numElements,
+ Value stride = nullptr, Value elementsPerStride = nullptr);
+
+ static AffineDmaStartOp create(ImplicitLocOpBuilder &builder, Value srcMemRef,
+ AffineMap srcMap, ValueRange srcIndices,
+ Value destMemRef, AffineMap dstMap,
+ ValueRange destIndices, Value tagMemRef,
+ AffineMap tagMap, ValueRange tagIndices,
+ Value numElements, Value stride = nullptr,
+ Value elementsPerStride = nullptr);
+
/// Returns the operand index of the source memref.
unsigned getSrcMemRefOperandIndex() { return 0; }
@@ -319,6 +334,12 @@ class AffineDmaWaitOp
static void build(OpBuilder &builder, OperationState &result, Value tagMemRef,
AffineMap tagMap, ValueRange tagIndices, Value numElements);
+ static AffineDmaWaitOp create(OpBuilder &builder, Location location,
+ Value tagMemRef, AffineMap tagMap,
+ ValueRange tagIndices, Value numElements);
+ static AffineDmaWaitOp create(ImplicitLocOpBuilder &builder, Value tagMemRef,
+ AffineMap tagMap, ValueRange tagIndices,
+ Value numElements);
static StringRef getOperationName() { return "affine.dma_wait"; }
diff --git a/mlir/include/mlir/Dialect/Arith/IR/Arith.h b/mlir/include/mlir/Dialect/Arith/IR/Arith.h
index 7c50c2036ffdc..0fc3db8e993d8 100644
--- a/mlir/include/mlir/Dialect/Arith/IR/Arith.h
+++ b/mlir/include/mlir/Dialect/Arith/IR/Arith.h
@@ -59,15 +59,27 @@ class ConstantIntOp : public arith::ConstantOp {
/// Build a constant int op that produces an integer of the specified width.
static void build(OpBuilder &builder, OperationState &result, int64_t value,
unsigned width);
+ static ConstantIntOp create(OpBuilder &builder, Location location,
+ int64_t value, unsigned width);
+ static ConstantIntOp create(ImplicitLocOpBuilder &builder, int64_t value,
+ unsigned width);
/// Build a constant int op that produces an integer of the specified type,
/// which must be an integer type.
static void build(OpBuilder &builder, OperationState &result, Type type,
int64_t value);
+ static ConstantIntOp create(OpBuilder &builder, Location location, Type type,
+ int64_t value);
+ static ConstantIntOp create(ImplicitLocOpBuilder &builder, Type type,
+ int64_t value);
/// Build a constant int op that produces an integer from an APInt
static void build(OpBuilder &builder, OperationState &result, Type type,
const APInt &value);
+ static ConstantIntOp create(OpBuilder &builder, Location location, Type type,
+ const APInt &value);
+ static ConstantIntOp create(ImplicitLocOpBuilder &builder, Type type,
+ const APInt &value);
inline int64_t value() {
return cast<IntegerAttr>(arith::ConstantOp::getValue()).getInt();
@@ -85,6 +97,10 @@ class ConstantFloatOp : public arith::ConstantOp {
/// Build a constant float op that produces a float of the specified type.
static void build(OpBuilder &builder, OperationState &result, FloatType type,
const APFloat &value);
+ static ConstantFloatOp create(OpBuilder &builder, Location location,
+ FloatType type, const APFloat &value);
+ static ConstantFloatOp create(ImplicitLocOpBuilder &builder, FloatType type,
+ const APFloat &value);
inline APFloat value() {
return cast<FloatAttr>(arith::ConstantOp::getValue()).getValue();
@@ -100,6 +116,9 @@ class ConstantIndexOp : public arith::ConstantOp {
static ::mlir::TypeID resolveTypeID() { return TypeID::get<ConstantOp>(); }
/// Build a constant int op that produces an index.
static void build(OpBuilder &builder, OperationState &result, int64_t value);
+ static ConstantIndexOp create(OpBuilder &builder, Location location,
+ int64_t value);
+ static ConstantIndexOp create(ImplicitLocOpBuilder &builder, int64_t value);
inline int64_t value() {
return cast<IntegerAttr>(arith::ConstantOp::getValue()).getInt();
diff --git a/mlir/lib/Dialect/Affine/IR/AffineOps.cpp b/mlir/lib/Dialect/Affine/IR/AffineOps.cpp
index e8e8f624d806e..bd1be7c087d05 100644
--- a/mlir/lib/Dialect/Affine/IR/AffineOps.cpp
+++ b/mlir/lib/Dialect/Affine/IR/AffineOps.cpp
@@ -240,7 +240,7 @@ Operation *AffineDialect::materializeConstant(OpBuilder &builder,
Attribute value, Type type,
Location loc) {
if (auto poison = dyn_cast<ub::PoisonAttr>(value))
- return builder.create<ub::PoisonOp>(loc, type, poison);
+ return ub::PoisonOp::create(builder, loc, type, poison);
return arith::ConstantOp::materialize(builder, value, type, loc);
}
@@ -1282,7 +1282,7 @@ mlir::affine::makeComposedAffineApply(OpBuilder &b, Location loc, AffineMap map,
map = foldAttributesIntoMap(b, map, operands, valueOperands);
composeAffineMapAndOperands(&map, &valueOperands, composeAffineMin);
assert(map);
- return b.create<AffineApplyOp>(loc, map, valueOperands);
+ return AffineApplyOp::create(b, loc, map, valueOperands);
}
AffineApplyOp
@@ -1389,7 +1389,7 @@ static OpTy makeComposedMinMax(OpBuilder &b, Location loc, AffineMap map,
SmallVector<Value> valueOperands;
map = foldAttributesIntoMap(b, map, operands, valueOperands);
composeMultiResultAffineMap(map, valueOperands);
- return b.create<OpTy>(loc, b.getIndexType(), map, valueOperands);
+ return OpTy::create(b, loc, b.getIndexType(), map, valueOperands);
}
AffineMinOp
@@ -1747,6 +1747,32 @@ void AffineDmaStartOp::build(OpBuilder &builder, OperationState &result,
}
}
+AffineDmaStartOp AffineDmaStartOp::create(
+ OpBuilder &builder, Location location, Value srcMemRef, AffineMap srcMap,
+ ValueRange srcIndices, Value destMemRef, AffineMap dstMap,
+ ValueRange destIndices, Value tagMemRef, AffineMap tagMap,
+ ValueRange tagIndices, Value numElements, Value stride,
+ Value elementsPerStride) {
+ mlir::OperationState state(location, getOperationName());
+ build(builder, state, srcMemRef, srcMap, srcIndices, destMemRef, dstMap,
+ destIndices, tagMemRef, tagMap, tagIndices, numElements, stride,
+ elementsPerStride);
+ auto result = llvm::dyn_cast<AffineDmaStartOp>(builder.create(state));
+ assert(result && "builder didn't return the right type");
+ return result;
+}
+
+AffineDmaStartOp AffineDmaStartOp::create(
+ ImplicitLocOpBuilder &builder, Value srcMemRef, AffineMap srcMap,
+ ValueRange srcIndices, Value destMemRef, AffineMap dstMap,
+ ValueRange destIndices, Value tagMemRef, AffineMap tagMap,
+ ValueRange tagIndices, Value numElements, Value stride,
+ Value elementsPerStride) {
+ return create(builder, builder.getLoc(), srcMemRef, srcMap, srcIndices,
+ destMemRef, dstMap, destIndices, tagMemRef, tagMap, tagIndices,
+ numElements, stride, elementsPerStride);
+}
+
void AffineDmaStartOp::print(OpAsmPrinter &p) {
p << " " << getSrcMemRef() << '[';
p.printAffineMapOfSSAIds(getSrcMapAttr(), getSrcIndices());
@@ -1917,6 +1943,25 @@ void AffineDmaWaitOp::build(OpBuilder &builder, OperationState &result,
result.addOperands(numElements);
}
+AffineDmaWaitOp AffineDmaWaitOp::create(OpBuilder &builder, Location location,
+ Value tagMemRef, AffineMap tagMap,
+ ValueRange tagIndices,
+ Value numElements) {
+ mlir::OperationState state(location, getOperationName());
+ build(builder, state, tagMemRef, tagMap, tagIndices, numElements);
+ auto result = llvm::dyn_cast<AffineDmaWaitOp>(builder.create(state));
+ assert(result && "builder didn't return the right type");
+ return result;
+}
+
+AffineDmaWaitOp AffineDmaWaitOp::create(ImplicitLocOpBuilder &builder,
+ Value tagMemRef, AffineMap tagMap,
+ ValueRange tagIndices,
+ Value numElements) {
+ return create(builder, builder.getLoc(), tagMemRef, tagMap, tagIndices,
+ numElements);
+}
+
void AffineDmaWaitOp::print(OpAsmPrinter &p) {
p << " " << getTagMemRef() << '[';
SmallVector<Value, 2> operands(getTagIndices());
@@ -2688,8 +2733,8 @@ FailureOr<LoopLikeOpInterface> AffineForOp::replaceWithAdditionalYields(
rewriter.setInsertionPoint(getOperation());
auto inits = llvm::to_vector(getInits());
inits.append(newInitOperands.begin(), newInitOperands.end());
- AffineForOp newLoop = rewriter.create<AffineForOp>(
- getLoc(), getLowerBoundOperands(), getLowerBoundMap(),
+ AffineForOp newLoop = AffineForOp::create(
+ rewriter, getLoc(), getLowerBoundOperands(), getLowerBoundMap(),
getUpperBoundOperands(), getUpperBoundMap(), getStepAsInt(), inits);
// Generate the new yield values and append them to the scf.yield operation.
@@ -2831,7 +2876,7 @@ static void buildAffineLoopNestImpl(
OpBuilder::InsertionGuard nestedGuard(nestedBuilder);
bodyBuilderFn(nestedBuilder, nestedLoc, ivs);
}
- nestedBuilder.create<AffineYieldOp>(nestedLoc);
+ AffineYieldOp::create(nestedBuilder, nestedLoc);
};
// Delegate actual loop creation to the callback in order to dispatch
@@ -2846,8 +2891,8 @@ static AffineForOp
buildAffineLoopFromConstants(OpBuilder &builder, Location loc, int64_t lb,
int64_t ub, int64_t step,
AffineForOp::BodyBuilderFn bodyBuilderFn) {
- return builder.create<AffineForOp>(loc, lb, ub, step,
- /*iterArgs=*/ValueRange(), bodyBuilderFn);
+ return AffineForOp::create(builder, loc, lb, ub, step,
+ /*iterArgs=*/ValueRange(), bodyBuilderFn);
}
/// Creates an affine loop from the bounds that may or may not be constants.
@@ -2860,9 +2905,9 @@ buildAffineLoopFromValues(OpBuilder &builder, Location loc, Value lb, Value ub,
if (lbConst && ubConst)
return buildAffineLoopFromConstants(builder, loc, lbConst.value(),
ubConst.value(), step, bodyBuilderFn);
- return builder.create<AffineForOp>(loc, lb, builder.getDimIdentityMap(), ub,
- builder.getDimIdentityMap(), step,
- /*iterArgs=*/ValueRange(), bodyBuilderFn);
+ return AffineForOp::create(builder, loc, lb, builder.getDimIdentityMap(), ub,
+ builder.getDimIdentityMap(), step,
+ /*iterArgs=*/ValueRange(), bodyBuilderFn);
}
void mlir::affine::buildAffineLoopNest(
@@ -4883,7 +4928,7 @@ struct DropUnitExtentBasis
Location loc = delinearizeOp->getLoc();
auto getZero = [&]() -> Value {
if (!zero)
- zero = rewriter.create<arith::ConstantIndexOp>(loc, 0);
+ zero = arith::ConstantIndexOp::create(rewriter, loc, 0);
return zero.value();
};
@@ -4906,8 +4951,8 @@ struct DropUnitExtentBasis
if (!newBasis.empty()) {
// Will drop the leading nullptr from `basis` if there was no outer bound.
- auto newDelinearizeOp = rewriter.create<affine::AffineDelinearizeIndexOp>(
- loc, delinearizeOp.getLinearIndex(), newBasis);
+ auto newDelinearizeOp = affine::AffineDelinearizeIndexOp::create(
+ rewriter, loc, delinearizeOp.getLinearIndex(), newBasis);
int newIndex = 0;
// Map back the new delinearized indices to the values they replace.
for (auto &replacement : replacements) {
@@ -4971,12 +5016,12 @@ struct CancelDelinearizeOfLinearizeDisjointExactTail
return success();
}
- Value newLinearize = rewriter.create<affine::AffineLinearizeIndexOp>(
- linearizeOp.getLoc(), linearizeIns.drop_back(numMatches),
+ Value newLinearize = affine::AffineLinearizeIndexOp::create(
+ rewriter, linearizeOp.getLoc(), linearizeIns.drop_back(numMatches),
ArrayRef<OpFoldResult>{linearizeBasis}.drop_back(numMatches),
linearizeOp.getDisjoint());
- auto newDelinearize = rewriter.create<affine::AffineDelinearizeIndexOp>(
- delinearizeOp.getLoc(), newLinearize,
+ auto newDelinearize = affine::AffineDelinearizeIndexOp::create(
+ rewriter, delinearizeOp.getLoc(), newLinearize,
ArrayRef<OpFoldResult>{delinearizeBasis}.drop_back(numMatches),
delinearizeOp.hasOuterBound());
SmallVector<Value> mergedResults(newDelinearize.getResults());
@@ -5048,19 +5093,16 @@ struct SplitDelinearizeSpanningLastLinearizeArg final
delinearizeOp,
"need at least two elements to form the basis product");
- Value linearizeWithoutBack =
- rewriter.create<affine::AffineLinearizeIndexOp>(
- linearizeOp.getLoc(), linearizeOp.getMultiIndex().drop_back(),
- linearizeOp.getDynamicBasis(),
- linearizeOp.getStaticBasis().drop_back(),
- linearizeOp.getDisjoint());
- auto delinearizeWithoutSplitPart =
- rewriter.create<affine::AffineDelinearizeIndexOp>(
- delinearizeOp.getLoc(), linearizeWithoutBack,
- delinearizeOp.getDynamicBasis(), basis.drop_back(elemsToSplit),
- delinearizeOp.hasOuterBound());
- auto delinearizeBack = rewriter.create<affine::AffineDelinearizeIndexOp>(
- delinearizeOp.getLoc(), linearizeOp.getMultiIndex().back(),
+ Value linearizeWithoutBack = affine::AffineLinearizeIndexOp::create(
+ rewriter, linearizeOp.getLoc(), linearizeOp.getMultiIndex().drop_back(),
+ linearizeOp.getDynamicBasis(), linearizeOp.getStaticBasis().drop_back(),
+ linearizeOp.getDisjoint());
+ auto delinearizeWithoutSplitPart = affine::AffineDelinearizeIndexOp::create(
+ rewriter, delinearizeOp.getLoc(), linearizeWithoutBack,
+ delinearizeOp.getDynamicBasis(), basis.drop_back(elemsToSplit),
+ delinearizeOp.hasOuterBound());
+ auto delinearizeBack = affine::AffineDelinearizeIndexOp::create(
+ rewriter, delinearizeOp.getLoc(), linearizeOp.getMultiIndex().back(),
basis.take_back(elemsToSplit), /*hasOuterBound=*/true);
SmallVector<Value> results = llvm::to_vector(
llvm::concat<Value>(delinearizeWithoutSplitPart.getResults(),
@@ -5272,7 +5314,7 @@ OpFoldResult computeProduct(Location loc, OpBuilder &builder,
}
if (auto constant = dyn_cast<AffineConstantExpr>(result))
return getAsIndexOpFoldResult(builder.getContext(), constant.getValue());
- return builder.create<AffineApplyOp>(loc, result, dynamicPart).getResult();
+ return AffineApplyOp::create(builder, loc, result, dynamicPart).getResult();
}
/// If conseceutive outputs of a delinearize_index are linearized with the same
@@ -5437,16 +5479,16 @@ struct CancelLinearizeOfDelinearizePortion final
newDelinBasis.erase(newDelinBasis.begin() + m.delinStart,
newDelinBasis.begin() + m.delinStart + m.length);
newDelinBasis.insert(newDelinBasis.begin() + m.delinStart, newSize);
- auto newDelinearize = rewriter.create<AffineDelinearizeIndexOp>(
- m.delinearize.getLoc(), m.delinearize.getLinearIndex(),
+ auto newDelinearize = AffineDelinearizeIndexOp::create(
+ rewriter, m.delinearize.getLoc(), m.delinearize.getLinearIndex(),
newDelinBasis);
// Since there may be other uses of the indices we just merged together,
// create a residual affine.delinearize_index that delinearizes the
// merged output into its component parts.
Value combinedElem = newDelinearize.getResult(m.delinStart);
- auto residualDelinearize = rewriter.create<AffineDelinearizeIndexOp>(
- m.delinearize.getLoc(), combinedElem, basisToMerge);
+ auto residualDelinearize = AffineDelinearizeIndexOp::create(
+ rewriter, m.delinearize.getLoc(), combinedElem, basisToMerge);
// Swap all the uses of the unaffected delinearize outputs to the new
// delinearization so that the old code can be removed if this
diff --git a/mlir/lib/Dialect/Arith/IR/ArithOps.cpp b/mlir/lib/Dialect/Arith/IR/ArithOps.cpp
index 4e40d4ebda004..ac00917d33a85 100644
--- a/mlir/lib/Dialect/Arith/IR/ArithOps.cpp
+++ b/mlir/lib/Dialect/Arith/IR/ArithOps.cpp
@@ -242,7 +242,7 @@ bool arith::ConstantOp::isBuildableWith(Attribute value, Type type) {
ConstantOp arith::ConstantOp::materialize(OpBuilder &builder, Attribute value,
Type type, Location loc) {
if (isBuildableWith(value, type))
- return builder.create<arith::ConstantOp>(loc, cast<TypedAttr>(value));
+ return arith::ConstantOp::create(builder, loc, cast<TypedAttr>(value));
return nullptr;
}
@@ -255,18 +255,66 @@ void arith::ConstantIntOp::build(OpBuilder &builder, OperationState &result,
builder.getIntegerAttr(type, value));
}
+arith::ConstantIntOp arith::ConstantIntOp::create(OpBuilder &builder,
+ Location location,
+ int64_t value,
+ unsigned width) {
+ mlir::OperationState state(location, getOperationName());
+ build(builder, state, value, width);
+ auto result = llvm::dyn_cast<ConstantIntOp>(builder.create(state));
+ assert(result && "builder didn't return the right type");
+ return result;
+}
+
+arith::ConstantIntOp arith::ConstantIntOp::create(ImplicitLocOpBuilder &builder,
+ int64_t value,
+ unsigned width) {
+ return create(builder, builder.getLoc(), value, width);
+}
+
void arith::ConstantIntOp::build(OpBuilder &builder, OperationState &result,
Type type, int64_t value) {
arith::ConstantOp::build(builder, result, type,
builder.getIntegerAttr(type, value));
}
+arith::ConstantIntOp arith::ConstantIntOp::create(OpBuilder &builder,
+ Location location, Type type,
+ int64_t value) {
+ mlir::OperationState state(location, getOperationName());
+ build(builder, state, type, value);
+ auto result = llvm::dyn_cast<ConstantIntOp>(builder.create(state));
+ assert(result && "builder didn't return the right type");
+ return result;
+}
+
+arith::ConstantIntOp arith::ConstantIntOp::create(ImplicitLocOpBuilder &builder,
+ Type type, int64_t value) {
+ return create(builder, builder.getLoc(), type, value);
+}
+
void arith::ConstantIntOp::build(OpBuilder &builder, OperationState &result,
Type type, const APInt &value) {
arith::ConstantOp::build(builder, result, type,
builder.getIntegerAttr(type, value));
}
+arith::ConstantIntOp arith::ConstantIntOp::create(OpBuilder &builder,
+ Location location, Type type,
+ const APInt &value) {
+ mlir::OperationState state(loc...
[truncated]
|
| build(builder, state, srcMemRef, srcMap, srcIndices, destMemRef, dstMap, | ||
| destIndices, tagMemRef, tagMap, tagIndices, numElements, stride, | ||
| elementsPerStride); | ||
| auto result = llvm::dyn_cast<AffineDmaStartOp>(builder.create(state)); |
There was a problem hiding this comment.
nit: I don't think we need these llvm:: namespaces being explicit in front of casts. Also everywhere else.
There was a problem hiding this comment.
removed in both files
Taken from git history: 9e7834c Maksim Levental [mlir][NFC] update `mlir/lib` create APIs (35/n) (#150708) 284a5c2 Maksim Levental [mlir][NFC] update `mlir/examples` create APIs (31/n) (#150652) c090ed5 Maksim Levental [mlir][NFC] update `mlir/Dialect` create APIs (33/n) (#150659) fcbcfe4 Maksim Levental [mlir][NFC] update `mlir/Dialect` create APIs (32/n) (#150657) 258daf5 Maksim Levental [mlir][NFC] update `mlir` create APIs (34/n) (#150660) c610b24 Maksim Levental [mlir][NFC] update `mlir/Dialect` create APIs (27/n) (#150638) b58ad36 Maksim Levental [mlir][NFC] update `mlir/Dialect` create APIs (30/n) (#150643) 258d04c Maksim Levental [mlir][NFC] update `mlir/Dialect` create APIs (28/n) (#150641) a6bf40d Maksim Levental [mlir][NFC] update `mlir/Dialect` create APIs (29/n) (#150642) dcfc853 Maksim Levental [mlir][NFC] update `flang/lib` create APIs (12/n) (#149914) 3f74334 Maksim Levental [mlir][NFC] update `flang` create APIs (13/n) (#149913) a636b7b Maksim Levental [mlir][NFC] update `mlir/Dialect` create APIs (18/n) (#149925) 75aa706 Maksim Levental [mlir][NFC] update `mlir/Dialect` create APIs (17/n) (#149924) 2f53125 Maksim Levental [mlir][NFC] update `mlir/Dialect` create APIs (15/n) (#149921) 967626b Maksim Levental [mlir][NFC] update `mlir/Dialect` create APIs (14/n) (#149920) 588845d Maksim Levental [mlir][NFC] update `mlir/Dialect` create APIs (20/n) (#149927) b043492 Maksim Levental [mlir][NFC] update `Conversion` create APIs (4/n) (#149879) 8fff238 Maksim Levental [mlir][NFC] update `mlir/Dialect` create APIs (23/n) (#149930) 38976a0 Maksim Levental [mlir][NFC] update `Conversion` create APIs (7/n) (#149889) eaa67a3 Maksim Levental [mlir][NFC] update `Conversion` create APIs (5/n) (#149887) b0312be Maksim Levental [mlir][NFC] update `mlir/Dialect` create APIs (19/n) (#149926) 2736fbd Maksim Levental [mlir][NFC] update `mlir/lib` create APIs (26/n) (#149933) 4ae9fdc Maksim Levental [mlir][NFC] update `Conversion` create APIs (6/n) (#149888) f904cdd Maksim Levental [mlir][NFC] update `mlir/Dialect` create APIs (24/n) (#149931) 972ac59 Maksim Levental [mlir][NFC] update `mlir/Dialect` create APIs (21/n) (#149928) 7b78796 Maksim Levental [mlir][NFC] update `mlir/Dialect` create APIs (25/n) (#149932) c3823af Maksim Levental [mlir][NFC] update `mlir/Dialect` create APIs (22/n) (#149929) dce6679 Maksim Levental [mlir][NFC] update `mlir/Dialect` create APIs (16/n) (#149922) 9844ba6 Maksim Levental [mlir][NFC] update `flang/Optimizer/Builder` create APIs (9/n) (#149917) 5547c6c Maksim Levental [mlir][NFC] update `flang/Optimizer/Builder/Runtime` create APIs (10/n) (#149916) a3a007a Maksim Levental [mlir][NFC] update `flang/Lower` create APIs (8/n) (#149912) 46f6df0 Maksim Levental [mlir][NFC] update `flang/Optimizer/Transforms` create APIs (11/n) (#149915) b7e332d Maksim Levental [mlir][NFC] update `include` create APIs (3/n) (#149687) 6056f94 Maksim Levental [mlir][NFC] update LLVM create APIs (2/n) (#149667) 906295b Maksim Levental [mlir] update affine+arith create APIs (1/n) (#149656)
The update is most likely not what someone wants when looking at the blame for one of these lines. Taken from git history: ``` 9e7834c Maksim Levental [mlir][NFC] update `mlir/lib` create APIs (35/n) (#150708) 284a5c2 Maksim Levental [mlir][NFC] update `mlir/examples` create APIs (31/n) (#150652) c090ed5 Maksim Levental [mlir][NFC] update `mlir/Dialect` create APIs (33/n) (#150659) fcbcfe4 Maksim Levental [mlir][NFC] update `mlir/Dialect` create APIs (32/n) (#150657) 258daf5 Maksim Levental [mlir][NFC] update `mlir` create APIs (34/n) (#150660) c610b24 Maksim Levental [mlir][NFC] update `mlir/Dialect` create APIs (27/n) (#150638) b58ad36 Maksim Levental [mlir][NFC] update `mlir/Dialect` create APIs (30/n) (#150643) 258d04c Maksim Levental [mlir][NFC] update `mlir/Dialect` create APIs (28/n) (#150641) a6bf40d Maksim Levental [mlir][NFC] update `mlir/Dialect` create APIs (29/n) (#150642) dcfc853 Maksim Levental [mlir][NFC] update `flang/lib` create APIs (12/n) (#149914) 3f74334 Maksim Levental [mlir][NFC] update `flang` create APIs (13/n) (#149913) a636b7b Maksim Levental [mlir][NFC] update `mlir/Dialect` create APIs (18/n) (#149925) 75aa706 Maksim Levental [mlir][NFC] update `mlir/Dialect` create APIs (17/n) (#149924) 2f53125 Maksim Levental [mlir][NFC] update `mlir/Dialect` create APIs (15/n) (#149921) 967626b Maksim Levental [mlir][NFC] update `mlir/Dialect` create APIs (14/n) (#149920) 588845d Maksim Levental [mlir][NFC] update `mlir/Dialect` create APIs (20/n) (#149927) b043492 Maksim Levental [mlir][NFC] update `Conversion` create APIs (4/n) (#149879) 8fff238 Maksim Levental [mlir][NFC] update `mlir/Dialect` create APIs (23/n) (#149930) 38976a0 Maksim Levental [mlir][NFC] update `Conversion` create APIs (7/n) (#149889) eaa67a3 Maksim Levental [mlir][NFC] update `Conversion` create APIs (5/n) (#149887) b0312be Maksim Levental [mlir][NFC] update `mlir/Dialect` create APIs (19/n) (#149926) 2736fbd Maksim Levental [mlir][NFC] update `mlir/lib` create APIs (26/n) (#149933) 4ae9fdc Maksim Levental [mlir][NFC] update `Conversion` create APIs (6/n) (#149888) f904cdd Maksim Levental [mlir][NFC] update `mlir/Dialect` create APIs (24/n) (#149931) 972ac59 Maksim Levental [mlir][NFC] update `mlir/Dialect` create APIs (21/n) (#149928) 7b78796 Maksim Levental [mlir][NFC] update `mlir/Dialect` create APIs (25/n) (#149932) c3823af Maksim Levental [mlir][NFC] update `mlir/Dialect` create APIs (22/n) (#149929) dce6679 Maksim Levental [mlir][NFC] update `mlir/Dialect` create APIs (16/n) (#149922) 9844ba6 Maksim Levental [mlir][NFC] update `flang/Optimizer/Builder` create APIs (9/n) (#149917) 5547c6c Maksim Levental [mlir][NFC] update `flang/Optimizer/Builder/Runtime` create APIs (10/n) (#149916) a3a007a Maksim Levental [mlir][NFC] update `flang/Lower` create APIs (8/n) (#149912) 46f6df0 Maksim Levental [mlir][NFC] update `flang/Optimizer/Transforms` create APIs (11/n) (#149915) b7e332d Maksim Levental [mlir][NFC] update `include` create APIs (3/n) (#149687) 6056f94 Maksim Levental [mlir][NFC] update LLVM create APIs (2/n) (#149667) 906295b Maksim Levental [mlir] update affine+arith create APIs (1/n) (#149656) ```
This PR updates create APIs for arith and affine - specifically these are the only in-tree dialects/ops with "custom" builders: ``` AffineDmaStartOp AffineDmaWaitOp ConstantIntOp ConstantFloatOp ConstantIndexOp ``` See llvm#147168 for more info.
The update is most likely not what someone wants when looking at the blame for one of these lines. Taken from git history: ``` 9e7834c Maksim Levental [mlir][NFC] update `mlir/lib` create APIs (35/n) (llvm#150708) 284a5c2 Maksim Levental [mlir][NFC] update `mlir/examples` create APIs (31/n) (llvm#150652) c090ed5 Maksim Levental [mlir][NFC] update `mlir/Dialect` create APIs (33/n) (llvm#150659) fcbcfe4 Maksim Levental [mlir][NFC] update `mlir/Dialect` create APIs (32/n) (llvm#150657) 258daf5 Maksim Levental [mlir][NFC] update `mlir` create APIs (34/n) (llvm#150660) c610b24 Maksim Levental [mlir][NFC] update `mlir/Dialect` create APIs (27/n) (llvm#150638) b58ad36 Maksim Levental [mlir][NFC] update `mlir/Dialect` create APIs (30/n) (llvm#150643) 258d04c Maksim Levental [mlir][NFC] update `mlir/Dialect` create APIs (28/n) (llvm#150641) a6bf40d Maksim Levental [mlir][NFC] update `mlir/Dialect` create APIs (29/n) (llvm#150642) dcfc853 Maksim Levental [mlir][NFC] update `flang/lib` create APIs (12/n) (llvm#149914) 3f74334 Maksim Levental [mlir][NFC] update `flang` create APIs (13/n) (llvm#149913) a636b7b Maksim Levental [mlir][NFC] update `mlir/Dialect` create APIs (18/n) (llvm#149925) 75aa706 Maksim Levental [mlir][NFC] update `mlir/Dialect` create APIs (17/n) (llvm#149924) 2f53125 Maksim Levental [mlir][NFC] update `mlir/Dialect` create APIs (15/n) (llvm#149921) 967626b Maksim Levental [mlir][NFC] update `mlir/Dialect` create APIs (14/n) (llvm#149920) 588845d Maksim Levental [mlir][NFC] update `mlir/Dialect` create APIs (20/n) (llvm#149927) b043492 Maksim Levental [mlir][NFC] update `Conversion` create APIs (4/n) (llvm#149879) 8fff238 Maksim Levental [mlir][NFC] update `mlir/Dialect` create APIs (23/n) (llvm#149930) 38976a0 Maksim Levental [mlir][NFC] update `Conversion` create APIs (7/n) (llvm#149889) eaa67a3 Maksim Levental [mlir][NFC] update `Conversion` create APIs (5/n) (llvm#149887) b0312be Maksim Levental [mlir][NFC] update `mlir/Dialect` create APIs (19/n) (llvm#149926) 2736fbd Maksim Levental [mlir][NFC] update `mlir/lib` create APIs (26/n) (llvm#149933) 4ae9fdc Maksim Levental [mlir][NFC] update `Conversion` create APIs (6/n) (llvm#149888) f904cdd Maksim Levental [mlir][NFC] update `mlir/Dialect` create APIs (24/n) (llvm#149931) 972ac59 Maksim Levental [mlir][NFC] update `mlir/Dialect` create APIs (21/n) (llvm#149928) 7b78796 Maksim Levental [mlir][NFC] update `mlir/Dialect` create APIs (25/n) (llvm#149932) c3823af Maksim Levental [mlir][NFC] update `mlir/Dialect` create APIs (22/n) (llvm#149929) dce6679 Maksim Levental [mlir][NFC] update `mlir/Dialect` create APIs (16/n) (llvm#149922) 9844ba6 Maksim Levental [mlir][NFC] update `flang/Optimizer/Builder` create APIs (9/n) (llvm#149917) 5547c6c Maksim Levental [mlir][NFC] update `flang/Optimizer/Builder/Runtime` create APIs (10/n) (llvm#149916) a3a007a Maksim Levental [mlir][NFC] update `flang/Lower` create APIs (8/n) (llvm#149912) 46f6df0 Maksim Levental [mlir][NFC] update `flang/Optimizer/Transforms` create APIs (11/n) (llvm#149915) b7e332d Maksim Levental [mlir][NFC] update `include` create APIs (3/n) (llvm#149687) 6056f94 Maksim Levental [mlir][NFC] update LLVM create APIs (2/n) (llvm#149667) 906295b Maksim Levental [mlir] update affine+arith create APIs (1/n) (llvm#149656) ```
This PR updates create APIs for arith and affine - specifically these are the only in-tree dialects/ops with "custom" builders:
Every "update" PR after this one will be a simple regex.
See #147168 for more info.