File tree Expand file tree Collapse file tree 2 files changed +24
-0
lines changed
python/mlir/dialects/transform Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -55,6 +55,7 @@ def __init__(
55
55
remainder_loop_type : Type ,
56
56
target : Union [Operation , Value ],
57
57
* ,
58
+ peel_front : Union [bool , BoolAttr ] = False ,
58
59
fail_if_already_divisible : Union [bool , BoolAttr ] = False ,
59
60
ip = None ,
60
61
loc = None ,
@@ -63,6 +64,11 @@ def __init__(
63
64
main_loop_type ,
64
65
remainder_loop_type ,
65
66
_get_op_result_or_value (target ),
67
+ peel_front = (
68
+ peel_front
69
+ if isinstance (peel_front , BoolAttr )
70
+ else BoolAttr .get (peel_front )
71
+ ),
66
72
fail_if_already_divisible = (
67
73
fail_if_already_divisible
68
74
if isinstance (fail_if_already_divisible , BoolAttr )
Original file line number Diff line number Diff line change @@ -49,6 +49,24 @@ def loopPeel():
49
49
# CHECK-LABEL: TEST: loopPeel
50
50
# CHECK: = transform.loop.peel %
51
51
52
+ @run
53
+ def loopPeel_peel_front ():
54
+ sequence = transform .SequenceOp (
55
+ transform .FailurePropagationMode .Propagate ,
56
+ [],
57
+ transform .OperationType .get ("scf.for" ),
58
+ )
59
+ with InsertionPoint (sequence .body ):
60
+ loop .LoopPeelOp (
61
+ transform .AnyOpType .get (),
62
+ transform .AnyOpType .get (),
63
+ sequence .bodyTarget ,
64
+ peel_front = True ,
65
+ )
66
+ transform .YieldOp ()
67
+ # CHECK-LABEL: TEST: loopPeel_peel_front
68
+ # CHECK: = transform.loop.peel %[[ARG0:.*]] {peel_front = true}
69
+
52
70
53
71
@run
54
72
def loopPipeline ():
You can’t perform that action at this time.
0 commit comments