Late setting of SCEV NoWrap flags does bad with cache

Hi,

I think these two patches are related to the topic:

https://reviews.llvm.org/D41578 “[SCEV] Do not cache S → V if S is not equivalent of V”

  • It’s committed. It can cause generation of redundant instructions. We’ve got regressions due to it. The biggest one is 7.31% regression in Spec2k6 401.bzip2 on Cortex-A57(AArch64).

https://reviews.llvm.org/D42290 “[SCEV] Clear poison flags during expansion of SCEV”

  • This patch tries to fix regressions due to the D41578 patch.

Thanks,

Evgeny Astigeevich

Hi Evgeny,

Thanks for reaching out! These patches related to expander are not specifically about what I was implying. As far as I’m aware, they fix a functional problem (and sometimes there is some inefficiency in the result of their operation because we lack a clenup pass after). In my case, there is no functional bug. But there is unavility of SCEV to prove some trivial fact due to outdated memoized data.

I was talking about different caches (in fact, SCEV has a plenty of them). Specifically, I imply maps “SignedRanges”, “UnsignedRanges” and other maps that get touched by method “forgetMemoizedResults”.

Thanks,

Max