[llvm] [LoopFusion] Assert failure in the issue 80301 (PR #167837)
Sushant Gokhale via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 18 01:10:15 PST 2025
sushgokh wrote:
> I don't think this is a proper solution. Removing assertions and using them for a tie-breaker will eventually get us to completely symmetric instances such as #166560. There is no reason that two abritary loops in the CFG that are not even sequential have to be found a sequential order for.
If we want to limit the scope of fusion to just adjacent loops, then the checks can be completely removed I think. But in the given example(or the issue IR), there is much scope for improvement at the same loop depth level. For instance, post first fusion, we have 3 loops in the same sequence in the candidate set:
```
L3
L4
L12
```
There is still scope for merging L3/L4 and then L34 can be merged with L12. So, basically, this is a recursive procedure. By relaxing the assertions, we would be allowing such fusions by inserting plausible candidates for fusion.
https://github.com/llvm/llvm-project/pull/167837
More information about the llvm-commits
mailing list