[llvm] [DependenceAnalysis] Extending SIV to handle fusable loops (PR #128782)
via llvm-commits
llvm-commits at lists.llvm.org
Sun Aug 10 13:14:49 PDT 2025
amehsan wrote:
>
> If this patch adds new assumptions to the analysis results, we may need to update other existing uses. For example, if the improved results assume the conditions under which "LoopFuse works fine," then we need to replace code like:
>
> ```c++
> Dependence *Dep = DI->depends(Src, Dst);
> ```
>
> with something like:
>
> ```c++
> Dependence *Dep = DI->depends(Src, Dst);
> if (The same condition as in LoopFuse does not hold)
> return;
> ```
I would say this patch adds a new functionality to DA. Personally I don't see any reason to worry about this. I am not exactly sure what can go wrong and how, that is not an existing risk. However, I believe it is possible to add a new flag to DA interface to enable this new functionality. The default value could be false, to turn it off, and in loop fusion we can turn it on.
Alternatively we can do something like you suggest. We can add an assertion or condition for other clients of DA that checks source and destination are within one loop. But I am not sure how that would protect a future potential client of DA.
In any case, I don't see much benefit to either of these solutions, but if you think it is helpful I have no objections.
https://github.com/llvm/llvm-project/pull/128782
More information about the llvm-commits
mailing list