nod-ai / iree-amd-aie

IREE plugin repository for the AMD AIE accelerator
Apache License 2.0
46 stars 23 forks source link

[WIP] Prevent hoisting of Affine.apply #377

Open Abhishek-Varma opened 1 month ago

Abhishek-Varma commented 1 month ago

-- Affine.apply when hoisted out of the scf.for as part of iree-amdaie-create-aie-workgroup pass creates op dominating issue.

-- This commit/PR will be used to better collaborate/discuss on the issue.

Attaching the culprit IR log from the Matmul dispatch : https://gist.github.com/Abhishek-Varma/9e0f39fc3570521c1ee8d6e0032ef402

  1. It contains the IR before iree-amdaie-create-aie-workgroup.

  2. I tried to prefetch other possible fixes required, so after this stopgap fix the next issue is in controlcode-loop-unroll pass and the above Gist contains a short repro as well as the IR we get right before the pass.

    I tried triaging the above and found that the upstream API forallToForLoop is unable to replace the SSA values despite trying to inlineBlockBefore.