1 ; RUN: opt -S -passes=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, ptr addrspace(100), [1 x i64], [1 x i64], [1 x i64], i64, i64, ptr addrspace(100), ptr addrspace(100), i8, i64 }
8 ; Function Attrs: readnone
9 declare ptr @getaddr_ArrayImpl(ptr addrspace(100)) #0
11 ; Function Attrs: readnone
12 declare ptr @getaddr_i64(ptr 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 ptr @getaddr_ArrayImpl(ptr addrspace(100) undef)
22 ; CHECK-NEXT: %.pre = load ptr addrspace(100), ptr null, align 8
23 ; CHECK-NEXT: br label %loop
25 ; CHECK-NEXT: call ptr @getaddr_i64(ptr addrspace(100) %.pre)
26 ; CHECK-NEXT: br label %loop
29 %0 = call ptr @getaddr_ArrayImpl(ptr addrspace(100) undef)
33 %1 = call ptr @getaddr_ArrayImpl(ptr addrspace(100) undef)
34 %2 = load ptr addrspace(100), ptr null, align 8
35 %3 = call ptr @getaddr_i64(ptr addrspace(100) %2)
39 attributes #0 = { readnone }