[SCEV] Simplify invalidation after BE count calculation (NFCI)
authorNikita Popov <nikita.ppv@gmail.com>
Sat, 27 Nov 2021 15:17:09 +0000 (16:17 +0100)
committerNikita Popov <nikita.ppv@gmail.com>
Sat, 27 Nov 2021 15:35:06 +0000 (16:35 +0100)
commitc2550e342732d029c3a8ae1eff764d68b1abfc59
treebf969e46f8e1772573a8ac03c2ee5ab63b4ad5e6
parent1b2d58ba90cd72a8dfe1535b5fbecbefacc30016
[SCEV] Simplify invalidation after BE count calculation (NFCI)

After backedge taken counts have been calculated, we want to
invalidate all addrecs and dependent expressions in the loop,
because we might compute better results with the newly available
backedge taken counts. Previously this was done with a forgetLoop()
style use-def walk. With recent improvements to SCEV invalidation,
we can instead directly invalidate any SCEVs using addrecs in this
loop. This requires a great deal less subtlety to avoid invalidating
more than necessary, and in particular gets rid of the hack from
D113349. The change is similar to D114263 in spirit.
llvm/include/llvm/Analysis/ScalarEvolution.h
llvm/lib/Analysis/ScalarEvolution.cpp