@@ -53,8 +53,8 @@ void genCharacterCopy(mlir::Value src, mlir::Value srcLen, mlir::Value dst,
53
53
fir::StoreOp::create (builder, loc, load, dst);
54
54
return ;
55
55
}
56
- auto zero = builder. template create < mlir::arith::ConstantIndexOp>( loc, 0 );
57
- auto one = builder. template create < mlir::arith::ConstantIndexOp>( loc, 1 );
56
+ auto zero = mlir::arith::ConstantIndexOp::create (builder, loc, 0 );
57
+ auto one = mlir::arith::ConstantIndexOp::create (builder, loc, 1 );
58
58
auto toArrayTy = [&](fir::CharacterType ty) {
59
59
return fir::ReferenceType::get (fir::SequenceType::get (
60
60
fir::SequenceType::ShapeRef{fir::SequenceType::getUnknownExtent ()},
@@ -68,8 +68,8 @@ void genCharacterCopy(mlir::Value src, mlir::Value srcLen, mlir::Value dst,
68
68
return fir::ReferenceType::get (toEleTy (ty));
69
69
};
70
70
if (!srcLen && !dstLen && srcTy.getLen () >= dstTy.getLen ()) {
71
- auto upper = builder. template create <mlir::arith::ConstantIndexOp>(
72
- loc, dstTy.getLen () - 1 );
71
+ auto upper =
72
+ mlir::arith::ConstantIndexOp::create (builder, loc, dstTy.getLen () - 1 );
73
73
auto loop = fir::DoLoopOp::create (builder, loc, zero, upper, one);
74
74
auto insPt = builder.saveInsertionPoint ();
75
75
builder.setInsertionPointToStart (loop.getBody ());
@@ -92,26 +92,26 @@ void genCharacterCopy(mlir::Value src, mlir::Value srcLen, mlir::Value dst,
92
92
return ;
93
93
}
94
94
auto minusOne = [&](mlir::Value v) -> mlir::Value {
95
- return builder.template create <mlir::arith::SubIOp>(
96
- loc, fir::ConvertOp::create (builder, loc, one.getType (), v), one);
95
+ return mlir::arith::SubIOp::create (
96
+ builder, loc, fir::ConvertOp::create (builder, loc, one.getType (), v),
97
+ one);
97
98
};
98
99
mlir::Value len = dstLen ? minusOne (dstLen)
99
- : builder
100
- .template create <mlir::arith::ConstantIndexOp>(
101
- loc, dstTy.getLen () - 1 )
100
+ : mlir::arith::ConstantIndexOp::create (
101
+ builder, loc, dstTy.getLen () - 1 )
102
102
.getResult ();
103
103
auto loop = fir::DoLoopOp::create (builder, loc, zero, len, one);
104
104
auto insPt = builder.saveInsertionPoint ();
105
105
builder.setInsertionPointToStart (loop.getBody ());
106
106
mlir::Value slen =
107
- srcLen ? fir::ConvertOp::create (builder, loc, one. getType (), srcLen)
108
- . getResult ( )
109
- : builder
110
- . template create < mlir::arith::ConstantIndexOp>(
111
- loc, srcTy. getLen ())
112
- . getResult ();
113
- auto cond = builder. template create < mlir::arith::CmpIOp>(
114
- loc, mlir::arith::CmpIPredicate::slt, loop.getInductionVar (), slen);
107
+ srcLen
108
+ ? fir::ConvertOp::create (builder, loc, one. getType (), srcLen )
109
+ . getResult ()
110
+ : mlir::arith::ConstantIndexOp::create (builder, loc, srcTy. getLen ())
111
+ . getResult ();
112
+ auto cond =
113
+ mlir::arith::CmpIOp::create (builder, loc, mlir::arith::CmpIPredicate::slt,
114
+ loop.getInductionVar (), slen);
115
115
auto ifOp = fir::IfOp::create (builder, loc, cond, /* withElse=*/ true );
116
116
builder.setInsertionPointToStart (&ifOp.getThenRegion ().front ());
117
117
auto csrcTy = toArrayTy (srcTy);
@@ -189,7 +189,7 @@ originateIndices(mlir::Location loc, B &builder, mlir::Type memTy,
189
189
auto ty = fir::dyn_cast_ptrOrBoxEleTy (memTy);
190
190
assert (ty && mlir::isa<fir::SequenceType>(ty));
191
191
auto seqTy = mlir::cast<fir::SequenceType>(ty);
192
- auto one = builder. template create < mlir::arith::ConstantIndexOp>( loc, 1 );
192
+ auto one = mlir::arith::ConstantIndexOp::create (builder, loc, 1 );
193
193
const auto dimension = seqTy.getDimension ();
194
194
if (shapeVal) {
195
195
assert (dimension == mlir::cast<fir::ShapeOp>(shapeVal.getDefiningOp ())
@@ -200,7 +200,7 @@ originateIndices(mlir::Location loc, B &builder, mlir::Type memTy,
200
200
if (i.index () < dimension) {
201
201
assert (fir::isa_integer (i.value ().getType ()));
202
202
result.push_back (
203
- builder. template create < mlir::arith::AddIOp>( loc, i.value (), one));
203
+ mlir::arith::AddIOp::create (builder, loc, i.value (), one));
204
204
} else {
205
205
result.push_back (i.value ());
206
206
}
@@ -211,8 +211,8 @@ originateIndices(mlir::Location loc, B &builder, mlir::Type memTy,
211
211
unsigned origOff = 0 ;
212
212
for (auto i : llvm::enumerate (indices)) {
213
213
if (i.index () < dimension)
214
- result.push_back (builder. template create < mlir::arith::AddIOp>(
215
- loc, i. value (), origins[origOff++]));
214
+ result.push_back (mlir::arith::AddIOp::create (builder, loc, i. value (),
215
+ origins[origOff++]));
216
216
else
217
217
result.push_back (i.value ());
218
218
}
0 commit comments