• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; Test merging of blocks with phi nodes.
2;
3; RUN: opt < %s -simplifycfg -S | not grep N:
4;
5
6define i32 @test(i1 %a) {
7Q:
8        br i1 %a, label %N, label %M
9N:              ; preds = %Q
10        br label %M
11M:              ; preds = %N, %Q
12        ; It's ok to merge N and M because the incoming values for W are the
13        ; same for both cases...
14        %W = phi i32 [ 2, %N ], [ 2, %Q ]               ; <i32> [#uses=1]
15        %R = add i32 %W, 1              ; <i32> [#uses=1]
16        ret i32 %R
17}
18
19