• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: opt < %s -instcombine -S | FileCheck %s
2
3; CHECK: no_crash
4define float @no_crash(float %a) nounwind {
5entry:
6  br label %for.body
7
8for.body:
9  %sum.057 = phi float [ 0.000000e+00, %entry ], [ %add5, %bb0 ]
10  %add5 = fadd float %sum.057, %a    ; PR14592
11  br i1 undef, label %bb0, label %end
12
13bb0:
14  br label %for.body
15
16end:
17  ret float %add5
18}
19
20; CHECK-LABEL: @pr21377(
21define void @pr21377(i32) {
22entry:
23  br label %while.body
24
25while.body:                                       ; preds = %if.end, %entry
26  %phi1 = phi i64 [ undef, %entry ], [ %or2, %if.end ]
27  %zext = zext i32 %0 to i64
28  br i1 undef, label %if.end, label %if.else
29
30if.else:                                          ; preds = %while.body
31  %or1 = or i64 %phi1, %zext
32  %and = and i64 %or1, 4294967295
33  br label %if.end
34
35if.end:                                           ; preds = %if.else, %while.body
36  %phi2 = phi i64 [ %and, %if.else ], [ undef, %while.body ]
37  %or2 = or i64 %phi2, %zext
38  br label %while.body
39}
40