Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SafepointIRVerifier should ignore dead blocks and dead edges
Not only should SafepointIRVerifier ignore unreachable blocks (as suggested in https://reviews.llvm.org/D47011) but it also has to ignore dead blocks. In @test2 (see the new tests): br i1 true, label %right, label %left left: ... right: ... merge: %val = phi i8 addrspace(1)* [ ..., %left ], [ ..., %right ] use %val both left and right branches are reachable. If they collide then SafepointIRVerifier reports an error. Because of the foldable branch condition GVN finds the left branch dead and removes the phi node entry that merges values from right and left. Then the use comes from the right branch. This results in no collision. So, SafepointIRVerifier ends up in different results depending on either GVN is run or not. To solve this issue this patch adds Dead Block detection to SafepointIRVerifier which can ignore dead blocks while validating IR. The Dead Block detection algorithm is taken from GVN but modified to not split critical edges. That is needed to keep CFG unchanged by SafepointIRVerifier. Patch by Yevgeny Rouban. Reviewed By: anna, apilipenko, DaniilSuchkov Differential Revision: https://reviews.llvm.org/D47441 llvm-svn: 335473
- Loading branch information
Showing
1 changed file
with
189 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters