• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: opt -S -early-cse < %s | FileCheck %s
2; RUN: opt -S -basicaa -early-cse-memssa < %s | FileCheck %s
3target datalayout = "E-m:e-i64:64-n32:64"
4target triple = "powerpc64-unknown-linux-gnu"
5
6; Function Attrs: nounwind
7define i64 @f(i64 %x) #0 {
8entry:
9  %0 = call i64 @llvm.read_register.i64(metadata !0)
10  call void bitcast (void (...)* @foo to void ()*)()
11  %1 = call i64 @llvm.read_register.i64(metadata !0)
12  %add = add nsw i64 %0, %1
13  ret i64 %add
14}
15
16; CHECK-LABEL: @f
17; CHECK: call i64 @llvm.read_register.i64
18; CHECK: call i64 @llvm.read_register.i64
19
20; Function Attrs: nounwind readnone
21declare i64 @llvm.read_register.i64(metadata) #1
22
23; Function Attrs: nounwind
24declare void @llvm.write_register.i64(metadata, i64) #2
25
26declare void @foo(...)
27
28attributes #0 = { nounwind }
29attributes #1 = { nounwind readnone }
30attributes #2 = { nounwind }
31
32!llvm.named.register.r1 = !{!0}
33
34!0 = !{!"r1"}
35
36