[llvm] [SCEV][LV] Invalidate LCSSA exit phis more thoroughly (PR #69909)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 15 08:01:25 PST 2023
nikic wrote:
> I'm wondering if expressions other than SCEVUnknown could also cause issues? IIUC any operand from the SCEV expression for the phi could be used outside and wouldn't those uses need invalidating as well? They might not cause crashes via `isAvailableAtLoopEntry`, could they cause slightly incorrect BECounts?
We are invalidating everything *using* SCEVUnknowns defined in the loop. Keep in mind that forgetMemoizedResults() does a recursive walk over the users. So this is not just the SCEVUnknowns themselves.
I think the only other thing that we might need to consider as invalidation roots in addition to SCEVUnknown are SCEVAddRecs, as these are loop-defined values that are not based on SCEVUnknown. Though those would typically get invalided by forgetLoop() anyway. Do you think I should add addrec handling to be on the safe side?
https://github.com/llvm/llvm-project/pull/69909
More information about the llvm-commits
mailing list