[llvm] [SCEV] Try to fold ZExt/SExt of AddRec before existing lookup. (PR #208805)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 16 09:13:22 PDT 2026


================

----------------
fhahn wrote:

I am not sure if there's a more general way to handle this; the issue is that we construct a SCEV for the `zext` at a point where the inner expression is missing warp flags, hence cannot be optimized further and we add it to `UniqueSCEVs`.

AFAIK we currently never remove entries from `UniqueSCEVs`, which we would need to do to avoid the code movement. But even if we could do that, I am not sure if we could reliable detect and handle all places where we would strengthen the flags unfortunately.

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


More information about the llvm-commits mailing list