1 ; RUN: opt -S -gvn -enable-load-pre < %s | FileCheck %s
3 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
4 target triple = "x86_64-unknown-linux-gnu"
6 %ArrayImpl = type { i64, i64 addrspace(100)*, [1 x i64], [1 x i64], [1 x i64], i64, i64, double addrspace(100)*, double addrspace(100)*, i8, i64 }
8 ; Function Attrs: readnone
9 declare %ArrayImpl* @getaddr_ArrayImpl(%ArrayImpl addrspace(100)*) #0
11 ; Function Attrs: readnone
12 declare i64* @getaddr_i64(i64 addrspace(100)*) #0
14 ; Make sure that the test compiles without a crash.
15 ; Bug https://bugs.llvm.org/show_bug.cgi?id=34937
17 define hidden void @wrapon_fn173() {
19 ; CHECK-LABEL: @wrapon_fn173
21 ; CHECK-NEXT: call %ArrayImpl* @getaddr_ArrayImpl(%ArrayImpl addrspace(100)* undef)
22 ; CHECK-NEXT: %.pre = load i64 addrspace(100)*, i64 addrspace(100)** null, align 8
23 ; CHECK-NEXT: br label %loop
25 ; CHECK-NEXT: call i64* @getaddr_i64(i64 addrspace(100)* %.pre)
26 ; CHECK-NEXT: br label %loop
29 %0 = call %ArrayImpl* @getaddr_ArrayImpl(%ArrayImpl addrspace(100)* undef)
33 %1 = call %ArrayImpl* @getaddr_ArrayImpl(%ArrayImpl addrspace(100)* undef)
34 %2 = load i64 addrspace(100)*, i64 addrspace(100)** null, align 8
35 %3 = call i64* @getaddr_i64(i64 addrspace(100)* %2)
39 attributes #0 = { readnone }