nod-ai/iree-amd-aie

Update `iree-amdaie-peel-for-loop` to peel the last iteration as well

Abhishek-Varma opened this issue · 0 comments

Given the following IR :-

scf.for %arg0 = 0 to 100  steps 2{
   ...
   arith.add %cst, %arg0
   ...
}

We want to peel the prologue (1st iteration) and the epilogue (last iteration) :-

scf.for %arg0 = 0 to 2  steps 2{
   ...
   arith.add %cst, %arg0
   ...
}
scf.for %arg0 = 2 to 98  steps 2{
   ...
   arith.add %cst, %arg0
   ...
}
scf.for %arg0 = 98 to 100  steps 2{
   ...
   arith.add %cst, %arg0
   ...
}

The current pass is already achieving prologue peeling.

CC: @yzhang93 @MaheshRavishankar