Loop unswitching makes substantial changes to a loop that can also affect cached
SCEV info in its outer loops as well, but it only cares to invalidate SCEV cache for the
innermost loop in case of full unswitching and does not invalidate anything at all in
case of trivial unswitching. As result, we may end up with incorrect data in cache.
Details
Details
Diff Detail
Diff Detail
Event Timeline
Comment Actions
This one appeared to be a real bug, at least we have a test that fails with assert for trivial unswitching. Thanks @uabelho for providing the test case.
Comment Actions
Thanks Max! This solves the problem I saw!
Not sure if I'm allowed to "LGTM" this but the change makes sense to me.
Comment Actions
Actually particularly with case of unswitching, I grow hesitant about one of our asserts that fails here. Maybe it is over-conservative. See comment https://reviews.llvm.org/D44676#1086144
I will check if its removal actually helps.