[PATCH] D21483: [PM] Port Dead Loop Deletion Pass to the new PM
Sean Silva via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 20 08:48:24 PDT 2016
silvas added a reviewer: davide.
silvas added a comment.
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.
http://reviews.llvm.org/D21483
More information about the llvm-commits
mailing list