[SimpleLoopUnswitch] Fix SCEV invalidation issue
This patch is making sure that we use getTopMostExitingLoop when finding out which loops to forget, when dealing with unswitchNontrivialInvariants and unswitchTrivialSwitch. It seems to at least be needed for unswitchNontrivialInvariants as detected by the included test case. Note that unswitchTrivialBranch already used getTopMostExitingLoop. This was done in commit 4a9cde5a. The commit message in that commit says "If the patch makes sense, I will also update those places to a similar approach ...", referring to these functions mentioned above. As far as I can tell that never happened, but this is an attempt to finally fix that. Fixes https://github.com/llvm/llvm-project/issues/61080 Differential Revision: https://reviews.llvm.org/D147058
Loading
Please sign in to comment