Fix error in FuseMultiUseElementwiseProducersPass#18855
Fix error in FuseMultiUseElementwiseProducersPass#18855IanWood1 wants to merge 3 commits intoiree-org:mainfrom
Conversation
|
This pass is very brittle because any constant hoisted out of a Edit: this is separate from this PR. I created an issue here #18856 |
`op` isn't included in `slice` so it must be independently checked to make sure it doesn't use any values defined above. Otherwise, a consumer that uses values defined above may be fused with a producer causing dominance errors. Closes iree-org#18847 Signed-off-by: Ian Wood <ianwood2024@u.northwestern.edu>
Signed-off-by: Ian Wood <ianwood2024@u.northwestern.edu>
37e4da8 to
89d8862
Compare
|
I think this is basically a bug in |
Signed-off-by: Ian Wood <ianwood2024@u.northwestern.edu>
I have something working, but the wrapper needs some cleanup because it's a bit confusing. |
The reverted commit does not handle when the "consumer" uses a value defined above. See #18879 for the original issue. This is causing issue with ~15 onnx models. I have a PR (#18855) to fix this by including values used in an ops region in the backwards slice, but It is waiting on upstream changes to `getBackwardSlice`. Currently, the PR is using a wrapper around `getBackwardSlice` to acheive the same effect, but this will be updated once the upstream change lands (llvm/llvm-project#113478) Reverts #18551 --------- Signed-off-by: Ian Wood <ianwood2024@u.northwestern.edu>
The reverted commit does not handle when the "consumer" uses a value defined above. See #18879 for the original issue. This is causing issue with ~15 onnx models. I have a PR (#18855) to fix this by including values used in an ops region in the backwards slice, but It is waiting on upstream changes to `getBackwardSlice`. Currently, the PR is using a wrapper around `getBackwardSlice` to acheive the same effect, but this will be updated once the upstream change lands (llvm/llvm-project#113478) Reverts #18551 --------- Signed-off-by: Ian Wood <ianwood2024@u.northwestern.edu> Signed-off-by: Elias Joseph <eljoseph@amd.com>
Since the upstream changes to `getBackwardSlice` have been integrated (llvm/llvm-project#114452), its now possible to reland #18855. The first commit relands the reverted changes. The second commit uses `BackwardSliceOptions::omitUsesFromAbove` to track all transitive definitions of the possibly fusible op preventing ops being moved before uses. Also, added two tests that check for this issue. Closes #18879 --------- Signed-off-by: Ian Wood <ianwood2024@u.northwestern.edu>
…rg#19032) Since the upstream changes to `getBackwardSlice` have been integrated (llvm/llvm-project#114452), its now possible to reland iree-org#18855. The first commit relands the reverted changes. The second commit uses `BackwardSliceOptions::omitUsesFromAbove` to track all transitive definitions of the possibly fusible op preventing ops being moved before uses. Also, added two tests that check for this issue. Closes iree-org#18879 --------- Signed-off-by: Ian Wood <ianwood2024@u.northwestern.edu>
…g#18917) The reverted commit does not handle when the "consumer" uses a value defined above. See iree-org#18879 for the original issue. This is causing issue with ~15 onnx models. I have a PR (iree-org#18855) to fix this by including values used in an ops region in the backwards slice, but It is waiting on upstream changes to `getBackwardSlice`. Currently, the PR is using a wrapper around `getBackwardSlice` to acheive the same effect, but this will be updated once the upstream change lands (llvm/llvm-project#113478) Reverts iree-org#18551 --------- Signed-off-by: Ian Wood <ianwood2024@u.northwestern.edu> Signed-off-by: Giacomo Serafini <179146510+giacs-epic@users.noreply.github.com>
…rg#19032) Since the upstream changes to `getBackwardSlice` have been integrated (llvm/llvm-project#114452), its now possible to reland iree-org#18855. The first commit relands the reverted changes. The second commit uses `BackwardSliceOptions::omitUsesFromAbove` to track all transitive definitions of the possibly fusible op preventing ops being moved before uses. Also, added two tests that check for this issue. Closes iree-org#18879 --------- Signed-off-by: Ian Wood <ianwood2024@u.northwestern.edu> Signed-off-by: Giacomo Serafini <179146510+giacs-epic@users.noreply.github.com>
isHorizontalToGroupdoesn't checkopto make sure it doesn't use any values defined above. This is a workaround for the fact thatgetBackwardsSlicedoesn't track ops if they are used in the region but not as an operand to the operation.Closes #18847