@@ -119,68 +119,68 @@ class SCFLoopLikeTest : public ::testing::Test {
119
119
120
120
TEST_F (SCFLoopLikeTest, queryUnidimensionalLooplikes) {
121
121
OwningOpRef<arith::ConstantIndexOp> lb =
122
- b. create < arith::ConstantIndexOp>( loc, 0 );
122
+ arith::ConstantIndexOp::create (b, loc, 0 );
123
123
OwningOpRef<arith::ConstantIndexOp> ub =
124
- b. create < arith::ConstantIndexOp>( loc, 10 );
124
+ arith::ConstantIndexOp::create (b, loc, 10 );
125
125
OwningOpRef<arith::ConstantIndexOp> step =
126
- b. create < arith::ConstantIndexOp>( loc, 2 );
126
+ arith::ConstantIndexOp::create (b, loc, 2 );
127
127
128
128
OwningOpRef<scf::ForOp> forOp =
129
- b. create < scf::ForOp>( loc, lb.get (), ub.get (), step.get ());
129
+ scf::ForOp::create (b, loc, lb.get (), ub.get (), step.get ());
130
130
checkUnidimensional (forOp.get ());
131
131
132
- OwningOpRef<scf::ForallOp> forallOp = b. create < scf::ForallOp> (
133
- loc, ArrayRef<OpFoldResult>(lb->getResult ()),
132
+ OwningOpRef<scf::ForallOp> forallOp = scf::ForallOp::create (
133
+ b, loc, ArrayRef<OpFoldResult>(lb->getResult ()),
134
134
ArrayRef<OpFoldResult>(ub->getResult ()),
135
135
ArrayRef<OpFoldResult>(step->getResult ()), ValueRange (), std::nullopt );
136
136
checkUnidimensional (forallOp.get ());
137
137
138
- OwningOpRef<scf::ParallelOp> parallelOp = b. create < scf::ParallelOp> (
139
- loc, ValueRange (lb->getResult ()), ValueRange (ub->getResult ()),
138
+ OwningOpRef<scf::ParallelOp> parallelOp = scf::ParallelOp::create (
139
+ b, loc, ValueRange (lb->getResult ()), ValueRange (ub->getResult ()),
140
140
ValueRange (step->getResult ()), ValueRange ());
141
141
checkUnidimensional (parallelOp.get ());
142
142
}
143
143
144
144
TEST_F (SCFLoopLikeTest, queryMultidimensionalLooplikes) {
145
145
OwningOpRef<arith::ConstantIndexOp> lb =
146
- b. create < arith::ConstantIndexOp>( loc, 0 );
146
+ arith::ConstantIndexOp::create (b, loc, 0 );
147
147
OwningOpRef<arith::ConstantIndexOp> ub =
148
- b. create < arith::ConstantIndexOp>( loc, 10 );
148
+ arith::ConstantIndexOp::create (b, loc, 10 );
149
149
OwningOpRef<arith::ConstantIndexOp> step =
150
- b. create < arith::ConstantIndexOp>( loc, 2 );
150
+ arith::ConstantIndexOp::create (b, loc, 2 );
151
151
152
- OwningOpRef<scf::ForallOp> forallOp = b. create < scf::ForallOp> (
153
- loc, ArrayRef<OpFoldResult>({lb->getResult (), lb->getResult ()}),
152
+ OwningOpRef<scf::ForallOp> forallOp = scf::ForallOp::create (
153
+ b, loc, ArrayRef<OpFoldResult>({lb->getResult (), lb->getResult ()}),
154
154
ArrayRef<OpFoldResult>({ub->getResult (), ub->getResult ()}),
155
155
ArrayRef<OpFoldResult>({step->getResult (), step->getResult ()}),
156
156
ValueRange (), std::nullopt );
157
157
checkMultidimensional (forallOp.get ());
158
158
159
- OwningOpRef<scf::ParallelOp> parallelOp = b. create < scf::ParallelOp> (
160
- loc, ValueRange ({lb->getResult (), lb->getResult ()}),
159
+ OwningOpRef<scf::ParallelOp> parallelOp = scf::ParallelOp::create (
160
+ b, loc, ValueRange ({lb->getResult (), lb->getResult ()}),
161
161
ValueRange ({ub->getResult (), ub->getResult ()}),
162
162
ValueRange ({step->getResult (), step->getResult ()}), ValueRange ());
163
163
checkMultidimensional (parallelOp.get ());
164
164
}
165
165
166
166
TEST_F (SCFLoopLikeTest, testForallNormalize) {
167
167
OwningOpRef<arith::ConstantIndexOp> lb =
168
- b. create < arith::ConstantIndexOp>( loc, 1 );
168
+ arith::ConstantIndexOp::create (b, loc, 1 );
169
169
OwningOpRef<arith::ConstantIndexOp> ub =
170
- b. create < arith::ConstantIndexOp>( loc, 10 );
170
+ arith::ConstantIndexOp::create (b, loc, 10 );
171
171
OwningOpRef<arith::ConstantIndexOp> step =
172
- b. create < arith::ConstantIndexOp>( loc, 3 );
172
+ arith::ConstantIndexOp::create (b, loc, 3 );
173
173
174
- scf::ForallOp forallOp = b. create < scf::ForallOp> (
175
- loc, ArrayRef<OpFoldResult>({lb->getResult (), lb->getResult ()}),
174
+ scf::ForallOp forallOp = scf::ForallOp::create (
175
+ b, loc, ArrayRef<OpFoldResult>({lb->getResult (), lb->getResult ()}),
176
176
ArrayRef<OpFoldResult>({ub->getResult (), ub->getResult ()}),
177
177
ArrayRef<OpFoldResult>({step->getResult (), step->getResult ()}),
178
178
ValueRange (), std::nullopt );
179
179
// Create a user of the induction variable. Bitcast is chosen for simplicity
180
180
// since it is unary.
181
181
b.setInsertionPointToStart (forallOp.getBody ());
182
- b. create < arith::BitcastOp>( UnknownLoc::get (&context), b.getF64Type (),
183
- forallOp.getInductionVar (0 ));
182
+ arith::BitcastOp::create (b, UnknownLoc::get (&context), b.getF64Type (),
183
+ forallOp.getInductionVar (0 ));
184
184
IRRewriter rewriter (b);
185
185
FailureOr<scf::ForallOp> maybeNormalizedForallOp =
186
186
normalizeForallOp (rewriter, forallOp);
0 commit comments