1 ; RUN: opt -loop-versioning -S < %s | FileCheck %s
3 ; NB: addrspaces 10-13 are non-integral
4 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128-ni:10:11:12:13"
6 %jl_value_t = type opaque
7 %jl_array_t = type { i8 addrspace(13)*, i64, i16, i16, i32 }
9 define void @"japi1_permutedims!_33509"(%jl_value_t addrspace(10)**) {
10 ; CHECK: [[CMP:%[^ ]*]] = icmp ult double addrspace(13)* [[A:%[^ ]*]], [[B:%[^ ]*]]
11 ; CHECK: [[SELECT:%[^ ]*]] = select i1 %18, double addrspace(13)* [[A]], double addrspace(13)* [[B]]
13 %1 = alloca [3 x i64], align 8
14 %2 = load %jl_value_t addrspace(10)*, %jl_value_t addrspace(10)** %0, align 8
15 %3 = getelementptr inbounds %jl_value_t addrspace(10)*, %jl_value_t addrspace(10)** %0, i64 1
16 %4 = load %jl_value_t addrspace(10)*, %jl_value_t addrspace(10)** %3, align 8
17 %5 = getelementptr inbounds [3 x i64], [3 x i64]* %1, i64 0, i64 0
18 store i64 1, i64* %5, align 8
19 %6 = getelementptr inbounds [3 x i64], [3 x i64]* %1, i64 0, i64 1
20 %7 = load i64, i64* inttoptr (i64 24 to i64*), align 8
21 %8 = addrspacecast %jl_value_t addrspace(10)* %4 to %jl_value_t addrspace(11)*
22 %9 = bitcast %jl_value_t addrspace(11)* %8 to double addrspace(13)* addrspace(11)*
23 %10 = load double addrspace(13)*, double addrspace(13)* addrspace(11)* %9, align 8
24 %11 = addrspacecast %jl_value_t addrspace(10)* %2 to %jl_value_t addrspace(11)*
25 %12 = bitcast %jl_value_t addrspace(11)* %11 to double addrspace(13)* addrspace(11)*
26 %13 = load double addrspace(13)*, double addrspace(13)* addrspace(11)* %12, align 8
27 %14 = load i64, i64* %6, align 8
31 %value_phi20 = phi i64 [ 1, %top ], [ %22, %L74 ]
32 %value_phi21 = phi i64 [ 1, %top ], [ %23, %L74 ]
33 %value_phi22 = phi i64 [ 1, %top ], [ %25, %L74 ]
34 %15 = add i64 %value_phi21, -1
35 %16 = getelementptr inbounds double, double addrspace(13)* %10, i64 %15
36 %17 = bitcast double addrspace(13)* %16 to i64 addrspace(13)*
37 %18 = load i64, i64 addrspace(13)* %17, align 8
38 %19 = add i64 %value_phi20, -1
39 %20 = getelementptr inbounds double, double addrspace(13)* %13, i64 %19
40 %21 = bitcast double addrspace(13)* %20 to i64 addrspace(13)*
41 store i64 %18, i64 addrspace(13)* %21, align 8
42 %22 = add i64 %value_phi20, 1
43 %23 = add i64 %14, %value_phi21
44 %24 = icmp eq i64 %value_phi22, %7
45 %25 = add i64 %value_phi22, 1
46 br i1 %24, label %L94, label %L74