Currently SplitBlockPredecessors generates incorrect code in case if basic block we are going to split has a landingpad. Also seems like it is fairly common case among it's users to conditionally call either SplitBlockPredecessors or SplitLandingPadPredecessors. Because of this I think it is reasonable to add this condition directly into SplitBlockPredecessors.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
Minor comments inline. Once these are addressed, I'm willing to give an LGTM. As we discussed offline, I plan on waiting another day or two to give other interested parties time to comment.
include/llvm/Transforms/Utils/BasicBlockUtils.h | ||
---|---|---|
205–213 | I'd suggest organizing the comment as: If BB does not contain a landingpad .... If BB does start with a landingpad ... | |
208 | Given there is no longer a NumPreds argument, you can delete that part. | |
lib/Transforms/Utils/BasicBlockUtils.cpp | ||
457–465 | Given this is just duplicated from the header, delete the comment here. | |
481 | Not sure it makes sense to add the extra suffix here. I'd just drop this. |
Given there is no longer a NumPreds argument, you can delete that part.