[llvm] [LICM] Invalidate cached SCEV results after reassociation (PR #92655)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Thu May 23 03:19:56 PDT 2024


nikic wrote:

> I thought about that, although 1) I feel like it overall feels more natural to modify in-place considering how the whole code here is structured around uses (which makes me wonder if rewriting the fold is worth it) 2) If we do this for hoistMulAddAssociation, I think we should rewrite the other reassociate and hoist folds here not to be in-place as well?

As far as I can tell, the only other cases doing in-place modification only modify icmps, which shouldn't matter from a SCEV perspective. But I think it would be better to create new instructions there as well.

3) It looks like we favour rewriting in-place when it comes to letting SCEV forget user in most of loop transform, but no strong opinions.

I'm not sure what you have in mind here, but I don't think this is the case... we usually favor creating new instruction over in-place modification to avoid these kinds of issues.

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


More information about the llvm-commits mailing list