1 ; RUN: llc -O3 -mcpu=cortex-a53 -mtriple=aarch64--linux-gnu %s -o - | FileCheck %s
2 ; PR20188: don't crash when merging sexts.
5 define void @foo() unnamed_addr align 2 {
7 br label %invoke.cont145
10 %or.cond = and i1 undef, false
11 br i1 %or.cond, label %if.then274, label %invoke.cont145
14 %0 = load i32, i32* null, align 4
15 br i1 undef, label %invoke.cont291, label %if.else313
18 %idxprom.i.i.i605 = sext i32 %0 to i64
19 %arrayidx.i.i.i607 = getelementptr inbounds double, double* undef, i64 %idxprom.i.i.i605
20 %idxprom.i.i.i596 = sext i32 %0 to i64
21 %arrayidx.i.i.i598 = getelementptr inbounds double, double* undef, i64 %idxprom.i.i.i596
25 %cmp314 = fcmp olt double undef, 0.000000e+00
26 br i1 %cmp314, label %invoke.cont317, label %invoke.cont353
29 br i1 undef, label %invoke.cont326, label %invoke.cont334
32 %idxprom.i.i.i587 = sext i32 %0 to i64
33 %arrayidx.i.i.i589 = getelementptr inbounds double, double* undef, i64 %idxprom.i.i.i587
34 %sub329 = fsub fast double undef, undef
35 br label %invoke.cont334
38 %lo.1 = phi double [ %sub329, %invoke.cont326 ], [ undef, %invoke.cont317 ]
39 br i1 undef, label %invoke.cont342, label %if.end356
42 %idxprom.i.i.i578 = sext i32 %0 to i64
43 %arrayidx.i.i.i580 = getelementptr inbounds double, double* undef, i64 %idxprom.i.i.i578
47 %idxprom.i.i.i572 = sext i32 %0 to i64
48 %arrayidx.i.i.i574 = getelementptr inbounds double, double* undef, i64 %idxprom.i.i.i572
52 %lo.2 = phi double [ 0.000000e+00, %invoke.cont291 ], [ %lo.1, %invoke.cont342 ], [ undef, %invoke.cont353 ], [ %lo.1, %invoke.cont334 ]
53 call void null(i32 %0, double %lo.2)