[llvm] [DependenceAnalysis] Extending SIV to handle fusable loops (PR #128782)

via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 8 07:25:58 PDT 2025


amehsan wrote:

> > If my understanding is correct this won't be a problem. Because the patch essentially says: let's assume the inner most loops are fused and then check the dependences
> 
> But they are not actually fused, and the client of DA is not only LoopFuse.
> 
> I didn't mean that the result is incorrect, but has changed due to the assumption of loop fusion. [This part](https://github.com/llvm/llvm-project/blob/4563cf607a25feabbaef6bb20076366437f01a2d/llvm/lib/Analysis/DependenceAnalysis.cpp#L4138-L4155) seems to attempt to split the result into two parts, with or without the assumption. However, the situation isn't that straightforward. The dependencies for `Levels < CommonLevels` would be affected by the assumption of loop-fusion. It might be noisy for clients other than LoopFuse (though I don't have a concrete example to illustrate it).


Yes, in some cases the result may change. My point is that this change will be an improvment as your earlier example demonstrates. We can not stop development of new features because they improve results that other components consume. What I was trying to highlight was that this change will not be a problem. 

https://github.com/llvm/llvm-project/pull/128782


More information about the llvm-commits mailing list