@@ -234,29 +234,33 @@ def LoopLikeOpInterface : OpInterface<"LoopLikeOpInterface"> {
234
234
/// If there is a single induction variable return it, otherwise return
235
235
/// std::nullopt.
236
236
::std::optional<::mlir::Value> getSingleInductionVar() {
237
- if (this->getInductionVars().size() == 1)
238
- return this->getInductionVars()[0];
237
+ auto inductionVars = this->getInductionVars();
238
+ if (inductionVars.size() == 1)
239
+ return inductionVars[0];
239
240
return std::nullopt;
240
241
}
241
242
/// Return the single lower bound value or attribute if it exists, otherwise
242
243
/// return std::nullopt.
243
244
::std::optional<::mlir::OpFoldResult> getSingleLowerBound() {
244
- if (this->getMixedLowerBound().size() == 1)
245
- return this->getMixedLowerBound()[0];
245
+ auto lowerBounds = this->getMixedLowerBound();
246
+ if (lowerBounds.size() == 1)
247
+ return lowerBounds[0];
246
248
return std::nullopt;
247
249
}
248
250
/// Return the single step value or attribute if it exists, otherwise
249
251
/// return std::nullopt.
250
252
::std::optional<::mlir::OpFoldResult> getSingleStep() {
251
- if (this->getMixedStep().size() == 1)
252
- return this->getMixedStep()[0];
253
+ auto steps = this->getMixedStep();
254
+ if (steps.size() == 1)
255
+ return steps[0];
253
256
return std::nullopt;
254
257
}
255
258
/// Return the single upper bound value or attribute if it exists, otherwise
256
259
/// return std::nullopt.
257
260
::std::optional<::mlir::OpFoldResult> getSingleUpperBound() {
258
- if (this->getMixedUpperBound().size() == 1)
259
- return this->getMixedUpperBound()[0];
261
+ auto upperBounds = this->getMixedUpperBound();
262
+ if (upperBounds.size() == 1)
263
+ return upperBounds[0];
260
264
return std::nullopt;
261
265
}
262
266
0 commit comments