• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: opt < %s -S -gvn-sink | FileCheck %s
2
3; Because %tmp17 has flipped operands to its equivalents %tmp14 and %tmp7, we
4; can't sink the zext as we'd need a shuffling PHI in between.
5;
6; Just sinking the zext isn't profitable, so ensure nothing is sunk.
7
8; CHECK-LABEL: @hoge
9; CHECK-NOT: bb18.gvnsink.split
10define void @hoge() {
11bb:
12  br i1 undef, label %bb4, label %bb11
13
14bb4:                                              ; preds = %bb3
15  br i1 undef, label %bb6, label %bb8
16
17bb6:                                              ; preds = %bb5
18  %tmp = zext i16 undef to i64
19  %tmp7 = add i64 %tmp, undef
20  br label %bb18
21
22bb8:                                              ; preds = %bb5
23  %tmp9 = zext i16 undef to i64
24  br label %bb18
25
26bb11:                                             ; preds = %bb10
27  br i1 undef, label %bb12, label %bb15
28
29bb12:                                             ; preds = %bb11
30  %tmp13 = zext i16 undef to i64
31  %tmp14 = add i64 %tmp13, undef
32  br label %bb18
33
34bb15:                                             ; preds = %bb11
35  %tmp16 = zext i16 undef to i64
36  %tmp17 = add i64 undef, %tmp16
37  br label %bb18
38
39bb18:                                             ; preds = %bb15, %bb12, %bb8, %bb6
40  %tmp19 = phi i64 [ %tmp7, %bb6 ], [ undef, %bb8 ], [ %tmp14, %bb12 ], [ %tmp17, %bb15 ]
41  unreachable
42}
43