• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; Test merging of blocks that only have PHI nodes in them.  This tests the case
2; where the mergedinto block doesn't have any PHI nodes, and is in fact
3; dominated by the block-to-be-eliminated
4;
5; RUN: opt < %s -simplifycfg -S | not grep N:
6;
7
8declare i1 @foo()
9
10define i32 @test(i1 %a, i1 %b) {
11        %c = call i1 @foo()
12	br i1 %c, label %N, label %P
13P:
14        %d = call i1 @foo()
15	br i1 %d, label %N, label %Q
16Q:
17	br label %N
18N:
19	%W = phi i32 [0, %0], [1, %Q], [2, %P]
20	; This block should be foldable into M
21	br label %M
22
23M:
24	%R = add i32 %W, 1
25	ret i32 %R
26}
27
28