[PATCH] D21483: [PM] Port Dead Loop Deletion Pass to the new PM

Davide Italiano via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 24 15:38:45 PDT 2016


davide added a comment.

In http://reviews.llvm.org/D21483#462155, @silvas wrote:

> Hi Jun Bum,
>
> First, thank you for taking the time to port this!
>
> My understanding is that there is currently an issue with the new PM which causes it to not behave as expected in response to the `loopInfo.markAsRemoved(L)` call.
>  The core issue is that it is using this generic code for running a sequence of loop passes:
>  https://github.com/llvm-project/llvm/blob/master/include/llvm/Analysis/LoopPassManager.h#L30
>  https://github.com/llvm-project/llvm/blob/master/include/llvm/IR/PassManager.h#L244
>  Even though a loop may be marked as deleted, it will continue to run passes on it.
>
> In the old PM, it will actually check if the loop was deleted and avoid running further passes on it:
>  https://github.com/llvm-project/llvm/blob/master/lib/Analysis/LoopPass.cpp#L204
>  https://github.com/llvm-project/llvm/blob/master/lib/Analysis/LoopPass.cpp#L238
>
> So my suspicion is that if you run loop passes after loop-deletion deletes a loop then the pass manager will start running passes on loops that have been deleted. What happens in that case? Will we hit assertions?
>
> (
>  also, the function to loop pass adaptor does not have any special handling for loop deletion; I'm not sure what that affects.
>  https://github.com/llvm-project/llvm/blob/master/include/llvm/Analysis/LoopPassManager.h#L84
>  )
>
> I've added Davide as a reviewer. He has been looking more closely at the loop passes and will hopefully be able to provide some more information.


Sean is absolutely right, this pass is blocked on some missing functionality in the new LoopPM. We're still discussing on what are the correct semantics/interfaces for the CGSCCPassManager, and after that the plan is to add the missing functionality to LoopPM. Please hold on until this is unblocked. Sorry.


http://reviews.llvm.org/D21483





More information about the llvm-commits mailing list