@@ -50,9 +50,9 @@ static Value buildMinMaxReductionSeq(Location loc,
50
50
Value value = *valueIt++;
51
51
for (; valueIt != values.end (); ++valueIt) {
52
52
if (predicate == arith::CmpIPredicate::sgt)
53
- value = builder. create < arith::MaxSIOp>( loc, value, *valueIt);
53
+ value = arith::MaxSIOp::create (builder, loc, value, *valueIt);
54
54
else
55
- value = builder. create < arith::MinSIOp>( loc, value, *valueIt);
55
+ value = arith::MinSIOp::create (builder, loc, value, *valueIt);
56
56
}
57
57
58
58
return value;
@@ -154,9 +154,9 @@ class AffineForLowering : public OpRewritePattern<AffineForOp> {
154
154
Value lowerBound = lowerAffineLowerBound (op, rewriter);
155
155
Value upperBound = lowerAffineUpperBound (op, rewriter);
156
156
Value step =
157
- rewriter. create < arith::ConstantIndexOp>( loc, op.getStepAsInt ());
158
- auto scfForOp = rewriter. create < scf::ForOp>( loc, lowerBound, upperBound,
159
- step, op.getInits ());
157
+ arith::ConstantIndexOp::create (rewriter, loc, op.getStepAsInt ());
158
+ auto scfForOp = scf::ForOp::create (rewriter, loc, lowerBound, upperBound,
159
+ step, op.getInits ());
160
160
rewriter.eraseBlock (scfForOp.getBody ());
161
161
rewriter.inlineRegionBefore (op.getRegion (), scfForOp.getRegion (),
162
162
scfForOp.getRegion ().end ());
@@ -197,17 +197,17 @@ class AffineParallelLowering : public OpRewritePattern<AffineParallelOp> {
197
197
}
198
198
steps.reserve (op.getSteps ().size ());
199
199
for (int64_t step : op.getSteps ())
200
- steps.push_back (rewriter. create < arith::ConstantIndexOp>( loc, step));
200
+ steps.push_back (arith::ConstantIndexOp::create (rewriter, loc, step));
201
201
202
202
// Get the terminator op.
203
203
auto affineParOpTerminator =
204
204
cast<AffineYieldOp>(op.getBody ()->getTerminator ());
205
205
scf::ParallelOp parOp;
206
206
if (op.getResults ().empty ()) {
207
207
// Case with no reduction operations/return values.
208
- parOp = rewriter. create < scf::ParallelOp>( loc, lowerBoundTuple,
209
- upperBoundTuple, steps,
210
- /* bodyBuilderFn=*/ nullptr );
208
+ parOp = scf::ParallelOp::create (rewriter, loc, lowerBoundTuple,
209
+ upperBoundTuple, steps,
210
+ /* bodyBuilderFn=*/ nullptr );
211
211
rewriter.eraseBlock (parOp.getBody ());
212
212
rewriter.inlineRegionBefore (op.getRegion (), parOp.getRegion (),
213
213
parOp.getRegion ().end ());
@@ -233,9 +233,9 @@ class AffineParallelLowering : public OpRewritePattern<AffineParallelOp> {
233
233
identityVals.push_back (
234
234
arith::getIdentityValue (reductionOpValue, resultType, rewriter, loc));
235
235
}
236
- parOp = rewriter. create < scf::ParallelOp>(
237
- loc, lowerBoundTuple, upperBoundTuple, steps, identityVals,
238
- /* bodyBuilderFn=*/ nullptr );
236
+ parOp = scf::ParallelOp::create (rewriter, loc, lowerBoundTuple,
237
+ upperBoundTuple, steps, identityVals,
238
+ /* bodyBuilderFn=*/ nullptr );
239
239
240
240
// Copy the body of the affine.parallel op.
241
241
rewriter.eraseBlock (parOp.getBody ());
@@ -261,7 +261,7 @@ class AffineParallelLowering : public OpRewritePattern<AffineParallelOp> {
261
261
Value reductionResult = arith::getReductionOp (
262
262
reductionOpValue, rewriter, loc, reductionBody.getArgument (0 ),
263
263
reductionBody.getArgument (1 ));
264
- rewriter. create < scf::ReduceReturnOp>( loc, reductionResult);
264
+ scf::ReduceReturnOp::create (rewriter, loc, reductionResult);
265
265
}
266
266
rewriter.replaceOp (op, parOp.getResults ());
267
267
return success ();
@@ -278,7 +278,7 @@ class AffineIfLowering : public OpRewritePattern<AffineIfOp> {
278
278
279
279
// Now we just have to handle the condition logic.
280
280
auto integerSet = op.getIntegerSet ();
281
- Value zeroConstant = rewriter. create < arith::ConstantIndexOp>( loc, 0 );
281
+ Value zeroConstant = arith::ConstantIndexOp::create (rewriter, loc, 0 );
282
282
SmallVector<Value, 8 > operands (op.getOperands ());
283
283
auto operandsRef = llvm::ArrayRef (operands);
284
284
@@ -298,18 +298,18 @@ class AffineIfLowering : public OpRewritePattern<AffineIfOp> {
298
298
auto pred =
299
299
isEquality ? arith::CmpIPredicate::eq : arith::CmpIPredicate::sge;
300
300
Value cmpVal =
301
- rewriter. create < arith::CmpIOp>( loc, pred, affResult, zeroConstant);
302
- cond = cond
303
- ? rewriter. create < arith::AndIOp>( loc, cond, cmpVal).getResult ()
304
- : cmpVal;
301
+ arith::CmpIOp::create (rewriter, loc, pred, affResult, zeroConstant);
302
+ cond =
303
+ cond ? arith::AndIOp::create (rewriter, loc, cond, cmpVal).getResult ()
304
+ : cmpVal;
305
305
}
306
306
cond = cond ? cond
307
- : rewriter. create < arith::ConstantIntOp>( loc, /* value=*/ 1 ,
308
- /* width=*/ 1 );
307
+ : arith::ConstantIntOp::create (rewriter, loc, /* value=*/ 1 ,
308
+ /* width=*/ 1 );
309
309
310
310
bool hasElseRegion = !op.getElseRegion ().empty ();
311
- auto ifOp = rewriter. create < scf::IfOp>( loc, op.getResultTypes (), cond,
312
- hasElseRegion);
311
+ auto ifOp = scf::IfOp::create (rewriter, loc, op.getResultTypes (), cond,
312
+ hasElseRegion);
313
313
rewriter.inlineRegionBefore (op.getThenRegion (),
314
314
&ifOp.getThenRegion ().back ());
315
315
rewriter.eraseBlock (&ifOp.getThenRegion ().back ());
0 commit comments