blob: 3411adbf245ef50c148515de85e5a75cb231f87c [file] [log] [blame]
Keno Fischer92f377b2016-12-05 21:25:03 +00001; RUN: opt -loop-versioning -S < %s | FileCheck %s
2; Checks that when introducing check, we don't accidentally introduce non-dominating instructions
3target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
4
5%Dual.212 = type { %Dual.213, %Partials.215 }
6%Dual.213 = type { double, %Partials.214 }
7%Partials.214 = type { [2 x double] }
8%Partials.215 = type { [2 x %Dual.213] }
9
10; Function Attrs: sspreq
11define void @"julia_axpy!_65480"(%Dual.212*) {
12top:
13 br label %if24
14
15; CHECK-NOT: %bc = bitcast i64* %v2.sroa.0.0..sroa_cast
16; CHECK: %bound0
17
18if24: ; preds = %if24, %top
19 %"#temp#1.sroa.3.02" = phi i64 [ undef, %top ], [ %2, %if24 ]
20 %"#temp#1.sroa.0.01" = phi i64 [ undef, %top ], [ %1, %if24 ]
21 %1 = add i64 %"#temp#1.sroa.0.01", 1
22 %2 = add i64 %"#temp#1.sroa.3.02", 1
23 ; This pointer is loop invariant. LAA used to re-use it from memcheck, even though it didn't dominate.
24 %v2.sroa.0.0..sroa_cast = bitcast %Dual.212* %0 to i64*
25 %v2.sroa.0.0.copyload = load i64, i64* %v2.sroa.0.0..sroa_cast, align 1
26 %3 = add i64 %"#temp#1.sroa.0.01", -1
27 %4 = getelementptr inbounds %Dual.212, %Dual.212* undef, i64 %3, i32 1, i32 0, i64 0, i32 1, i32 0, i64 0
28 %5 = bitcast double* %4 to i64*
29 store i64 undef, i64* %5, align 8
30 %notlhs27 = icmp eq i64 %2, undef
31 %notrhs28 = icmp eq i64 %1, undef
32 %6 = or i1 %notrhs28, %notlhs27
33 br i1 %6, label %L41.L335_crit_edge, label %if24
34
35L41.L335_crit_edge: ; preds = %if24
36 ret void
37}