• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: opt -S -gvn -enable-load-pre < %s | FileCheck %s
2
3target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
4target triple = "x86_64-unknown-linux-gnu"
5
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 }
7
8; Function Attrs: readnone
9declare %ArrayImpl* @getaddr_ArrayImpl(%ArrayImpl addrspace(100)*) #0
10
11; Function Attrs: readnone
12declare i64* @getaddr_i64(i64 addrspace(100)*) #0
13
14; Make sure that the test compiles without a crash.
15; Bug https://bugs.llvm.org/show_bug.cgi?id=34937
16
17define hidden void @wrapon_fn173() {
18
19; CHECK-LABEL: @wrapon_fn173
20; CHECK:       entry:
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
24; CHECK:       loop:
25; CHECK-NEXT:    call i64* @getaddr_i64(i64 addrspace(100)* %.pre)
26; CHECK-NEXT:    br label %loop
27
28entry:
29  %0 = call %ArrayImpl* @getaddr_ArrayImpl(%ArrayImpl addrspace(100)* undef)
30  br label %loop
31
32loop:
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)
36  br label %loop
37}
38
39attributes #0 = { readnone }
40