1 ; Test merging of blocks containing complex expressions,
2 ; with various folding thresholds
4 ; RUN: opt < %s -simplifycfg -S -phi-node-folding-threshold=1 | grep N:
5 ; RUN: opt < %s -simplifycfg -S -phi-node-folding-threshold=2 | not grep N:
6 ; RUN: opt < %s -simplifycfg -S -phi-node-folding-threshold=2 | grep M:
7 ; RUN: opt < %s -simplifycfg -S -phi-node-folding-threshold=7 | not grep M:
10 define i32 @test(i1 %a, i1 %b, i32 %i, i32 %j, i32 %k) {
12 br i1 %a, label %M, label %O
14 br i1 %b, label %P, label %Q
17 %iajak = add i32 %iaj, %k
21 %ixjxk = xor i32 %ixj, %k
24 ; This phi should be foldable if threshold >= 2
25 %Wp = phi i32 [ %iajak, %P ], [ %ixjxk, %Q ]
26 %Wp2 = add i32 %Wp, %Wp
29 ; This phi should be foldable if threshold >= 7
30 %W = phi i32 [ %Wp2, %N ], [ 2, %entry ]