File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed
mlir/include/mlir/Interfaces Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -220,6 +220,28 @@ def LoopLikeOpInterface : OpInterface<"LoopLikeOpInterface"> {
220
220
/*defaultImplementation=*/[{
221
221
return ::mlir::failure();
222
222
}]
223
+ >,
224
+ InterfaceMethod<[{
225
+ Add a zero-trip-check around the loop to check if the loop body is ever
226
+ run and return the new loop inside the check. The loop body is moved
227
+ over to the new loop. Returns "failure" if the loop doesn't support
228
+ this transformation.
229
+
230
+ After the transformation, the ops inserted to the parent region of the
231
+ loop are guaranteed to be run only if the loop body runs at least one
232
+ iteration.
233
+
234
+ Note: Ops in the loop body might be rearranged because of loop rotating
235
+ to maintain the semantic. Terminators might be removed/added during this
236
+ transformation.
237
+ }],
238
+ /*retTy=*/"::mlir::FailureOr<::mlir::LoopLikeOpInterface>",
239
+ /*methodName=*/"replaceWithZeroTripCheck",
240
+ /*args=*/(ins "::mlir::RewriterBase &":$rewriter),
241
+ /*methodBody=*/"",
242
+ /*defaultImplementation=*/[{
243
+ return ::mlir::failure();
244
+ }]
223
245
>
224
246
];
225
247
You can’t perform that action at this time.
0 commit comments