@@ -180,12 +180,12 @@ def LoopLikeOpInterface : OpInterface<"LoopLikeOpInterface"> {
180
180
For loop operations that dont yield a value, this should return
181
181
std::nullopt.
182
182
}],
183
- /*retTy=*/"std::optional<::llvm::MutableArrayRef<::mlir::OpOperand>>",
183
+ /*retTy=*/":: std::optional<::llvm::MutableArrayRef<::mlir::OpOperand>>",
184
184
/*methodName=*/"getYieldedValuesMutable",
185
185
/*args=*/(ins),
186
186
/*methodBody=*/"",
187
187
/*defaultImplementation=*/[{
188
- return std::nullopt;
188
+ return :: std::nullopt;
189
189
}]
190
190
>,
191
191
InterfaceMethod<[{
@@ -239,7 +239,7 @@ def LoopLikeOpInterface : OpInterface<"LoopLikeOpInterface"> {
239
239
/// Returns if a block is inside a loop (within the current function). This
240
240
/// can either be because the block is nested inside a LoopLikeInterface, or
241
241
/// because the control flow graph is cyclic
242
- static bool blockIsInLoop(Block *block);
242
+ static bool blockIsInLoop(::mlir:: Block *block);
243
243
}];
244
244
245
245
let extraSharedClassDeclaration = [{
@@ -249,31 +249,31 @@ def LoopLikeOpInterface : OpInterface<"LoopLikeOpInterface"> {
249
249
auto inductionVars = $_op.getLoopInductionVars();
250
250
if (inductionVars.has_value() && (*inductionVars).size() == 1)
251
251
return (*inductionVars)[0];
252
- return std::nullopt;
252
+ return :: std::nullopt;
253
253
}
254
254
/// Return the single lower bound value or attribute if it exists, otherwise
255
255
/// return std::nullopt.
256
256
::std::optional<::mlir::OpFoldResult> getSingleLowerBound() {
257
257
auto lowerBounds = $_op.getLoopLowerBounds();
258
258
if (lowerBounds.has_value() && (*lowerBounds).size() == 1)
259
259
return (*lowerBounds)[0];
260
- return std::nullopt;
260
+ return :: std::nullopt;
261
261
}
262
262
/// Return the single step value or attribute if it exists, otherwise
263
263
/// return std::nullopt.
264
264
::std::optional<::mlir::OpFoldResult> getSingleStep() {
265
265
auto steps = $_op.getLoopSteps();
266
266
if (steps.has_value() && (*steps).size() == 1)
267
267
return (*steps)[0];
268
- return std::nullopt;
268
+ return :: std::nullopt;
269
269
}
270
270
/// Return the single upper bound value or attribute if it exists, otherwise
271
271
/// return std::nullopt.
272
272
::std::optional<::mlir::OpFoldResult> getSingleUpperBound() {
273
273
auto upperBounds = $_op.getLoopUpperBounds();
274
274
if (upperBounds.has_value() && (*upperBounds).size() == 1)
275
275
return (*upperBounds)[0];
276
- return std::nullopt;
276
+ return :: std::nullopt;
277
277
}
278
278
279
279
/// Append the specified additional "init" operands: replace this loop with
@@ -287,8 +287,9 @@ def LoopLikeOpInterface : OpInterface<"LoopLikeOpInterface"> {
287
287
bool replaceInitOperandUsesInLoop) {
288
288
return $_op.replaceWithAdditionalYields(
289
289
rewriter, newInitOperands, replaceInitOperandUsesInLoop,
290
- [](OpBuilder &b, Location loc, ArrayRef<BlockArgument> newBBArgs) {
291
- return SmallVector<Value>(newBBArgs);
290
+ [](::mlir::OpBuilder &b, ::mlir::Location loc,
291
+ ::mlir::ArrayRef<::mlir::BlockArgument> newBBArgs) {
292
+ return ::mlir::SmallVector<::mlir::Value>(newBBArgs);
292
293
});
293
294
}
294
295
@@ -298,9 +299,9 @@ def LoopLikeOpInterface : OpInterface<"LoopLikeOpInterface"> {
298
299
auto mutableValues = $_op.getYieldedValuesMutable();
299
300
if (!mutableValues || mutableValues->empty())
300
301
return {};
301
- Operation *yieldOp = mutableValues->begin()->getOwner();
302
+ ::mlir:: Operation *yieldOp = mutableValues->begin()->getOwner();
302
303
unsigned firstOperandIndex = mutableValues->begin()->getOperandNumber();
303
- return OperandRange(
304
+ return ::mlir:: OperandRange(
304
305
yieldOp->operand_begin() + firstOperandIndex,
305
306
yieldOp->operand_begin() + firstOperandIndex + mutableValues->size());
306
307
}
@@ -312,107 +313,111 @@ def LoopLikeOpInterface : OpInterface<"LoopLikeOpInterface"> {
312
313
if (initsMutable.empty())
313
314
return ::mlir::OperandRange($_op->operand_end(), $_op->operand_end());
314
315
unsigned firstOperandIndex = initsMutable.begin()->getOperandNumber();
315
- return OperandRange(
316
+ return ::mlir:: OperandRange(
316
317
$_op->operand_begin() + firstOperandIndex,
317
318
$_op->operand_begin() + firstOperandIndex + initsMutable.size());
318
319
}
319
320
320
321
/// Return the region iter_arg that corresponds to the given init operand.
321
322
/// Return an "empty" block argument if the given operand is not an init
322
323
/// operand of this loop op.
323
- BlockArgument getTiedLoopRegionIterArg(OpOperand *opOperand) {
324
+ ::mlir::BlockArgument getTiedLoopRegionIterArg(
325
+ ::mlir::OpOperand *opOperand) {
324
326
auto initsMutable = $_op.getInitsMutable();
325
- auto it = llvm::find(initsMutable, *opOperand);
327
+ auto it = :: llvm::find(initsMutable, *opOperand);
326
328
if (it == initsMutable.end())
327
329
return {};
328
- return $_op.getRegionIterArgs()[std::distance(initsMutable.begin(), it)];
330
+ return $_op.getRegionIterArgs()[
331
+ ::std::distance(initsMutable.begin(), it)];
329
332
}
330
333
331
334
/// Return the region iter_arg that corresponds to the given loop result.
332
335
/// Return an "empty" block argument if the given OpResult is not a loop
333
336
/// result or if this op does not expose any loop results.
334
- BlockArgument getTiedLoopRegionIterArg(OpResult opResult) {
337
+ ::mlir:: BlockArgument getTiedLoopRegionIterArg(::mlir:: OpResult opResult) {
335
338
auto loopResults = $_op.getLoopResults();
336
339
if (!loopResults)
337
340
return {};
338
- auto it = llvm::find(*loopResults, opResult);
341
+ auto it = :: llvm::find(*loopResults, opResult);
339
342
if (it == loopResults->end())
340
343
return {};
341
- return $_op.getRegionIterArgs()[std::distance(loopResults->begin(), it)];
344
+ return $_op.getRegionIterArgs()[
345
+ ::std::distance(loopResults->begin(), it)];
342
346
}
343
347
344
348
/// Return the init operand that corresponds to the given region iter_arg.
345
349
/// Return "nullptr" if the given block argument is not a region iter_arg
346
350
/// of this loop op.
347
- OpOperand *getTiedLoopInit(BlockArgument bbArg) {
351
+ ::mlir:: OpOperand *getTiedLoopInit(::mlir:: BlockArgument bbArg) {
348
352
auto iterArgs = $_op.getRegionIterArgs();
349
- auto it = llvm::find(iterArgs, bbArg);
353
+ auto it = :: llvm::find(iterArgs, bbArg);
350
354
if (it == iterArgs.end())
351
355
return {};
352
- return &$_op.getInitsMutable()[std::distance(iterArgs.begin(), it)];
356
+ return &$_op.getInitsMutable()[:: std::distance(iterArgs.begin(), it)];
353
357
}
354
358
355
359
/// Return the init operand that corresponds to the given loop result.
356
360
/// Return "nullptr" if the given OpResult is not a loop result or if this
357
361
/// op does not expose any loop results.
358
- OpOperand *getTiedLoopInit(OpResult opResult) {
362
+ ::mlir:: OpOperand *getTiedLoopInit(::mlir:: OpResult opResult) {
359
363
auto loopResults = $_op.getLoopResults();
360
364
if (!loopResults)
361
365
return nullptr;
362
- auto it = llvm::find(*loopResults, opResult);
366
+ auto it = :: llvm::find(*loopResults, opResult);
363
367
if (it == loopResults->end())
364
368
return nullptr;
365
- return &$_op.getInitsMutable()[std::distance(loopResults->begin(), it)];
369
+ return &$_op.getInitsMutable()[::std::distance(
370
+ loopResults->begin(), it)];
366
371
}
367
372
368
373
/// Return the yielded value that corresponds to the given region iter_arg.
369
374
/// Return "nullptr" if the given block argument is not a region iter_arg
370
375
/// of this loop op or if there is no yield corresponding to this `bbArg`.
371
- OpOperand *getTiedLoopYieldedValue(BlockArgument bbArg) {
376
+ ::mlir:: OpOperand *getTiedLoopYieldedValue(::mlir:: BlockArgument bbArg) {
372
377
auto iterArgs = $_op.getRegionIterArgs();
373
- auto it = llvm::find(iterArgs, bbArg);
378
+ auto it = :: llvm::find(iterArgs, bbArg);
374
379
if (it == iterArgs.end())
375
380
return {};
376
- std::optional<llvm::MutableArrayRef<::mlir::OpOperand>> yieldValues =
381
+ :: std::optional<:: llvm::MutableArrayRef<::mlir::OpOperand>> yieldValues =
377
382
$_op.getYieldedValuesMutable();
378
383
if (!yieldValues)
379
384
return {};
380
- return &yieldValues.value()[std::distance(iterArgs.begin(), it)];
385
+ return &yieldValues.value()[:: std::distance(iterArgs.begin(), it)];
381
386
}
382
387
383
388
/// Return the loop result that corresponds to the given init operand.
384
389
/// Return an "empty" OpResult if the given operand is not an init operand
385
390
/// of this loop op or if this op does not expose any loop results.
386
- OpResult getTiedLoopResult(OpOperand *opOperand) {
391
+ ::mlir:: OpResult getTiedLoopResult(::mlir:: OpOperand *opOperand) {
387
392
auto loopResults = $_op.getLoopResults();
388
393
if (!loopResults)
389
394
return {};
390
395
auto initsMutable = $_op.getInitsMutable();
391
- auto it = llvm::find(initsMutable, *opOperand);
396
+ auto it = :: llvm::find(initsMutable, *opOperand);
392
397
if (it == initsMutable.end())
393
398
return {};
394
- return (*loopResults)[std::distance(initsMutable.begin(), it)];
399
+ return (*loopResults)[:: std::distance(initsMutable.begin(), it)];
395
400
}
396
401
397
402
/// Return the loop result that corresponds to the given region iter_arg.
398
403
/// Return an "empty" OpResult if the given block argument is not a region
399
404
/// iter_arg of this loop op or if this op does not expose any loop results.
400
- OpResult getTiedLoopResult(BlockArgument bbArg) {
405
+ ::mlir:: OpResult getTiedLoopResult(::mlir:: BlockArgument bbArg) {
401
406
auto loopResults = $_op.getLoopResults();
402
407
if (!loopResults)
403
408
return {};
404
409
auto iterArgs = $_op.getRegionIterArgs();
405
- auto it = llvm::find(iterArgs, bbArg);
410
+ auto it = :: llvm::find(iterArgs, bbArg);
406
411
if (it == iterArgs.end())
407
412
return {};
408
- return (*loopResults)[std::distance(iterArgs.begin(), it)];
413
+ return (*loopResults)[:: std::distance(iterArgs.begin(), it)];
409
414
}
410
415
}];
411
416
412
417
let verifyWithRegions = 1;
413
418
414
419
let verify = [{
415
- return detail::verifyLoopLikeOpInterface($_op);
420
+ return ::mlir:: detail::verifyLoopLikeOpInterface($_op);
416
421
}];
417
422
}
418
423
0 commit comments