You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
842 B
35 lines
842 B
4 months ago
|
; RUN: opt -S -early-cse < %s | FileCheck %s
|
||
|
target datalayout = "E-m:e-i64:64-n32:64"
|
||
|
target triple = "powerpc64-unknown-linux-gnu"
|
||
|
|
||
|
; Function Attrs: nounwind
|
||
|
define i64 @f(i64 %x) #0 {
|
||
|
entry:
|
||
|
%0 = call i64 @llvm.read_register.i64(metadata !0)
|
||
|
call void bitcast (void (...)* @foo to void ()*)()
|
||
|
%1 = call i64 @llvm.read_register.i64(metadata !0)
|
||
|
%add = add nsw i64 %0, %1
|
||
|
ret i64 %add
|
||
|
}
|
||
|
|
||
|
; CHECK-LABEL: @f
|
||
|
; CHECK: call i64 @llvm.read_register.i64
|
||
|
; CHECK: call i64 @llvm.read_register.i64
|
||
|
|
||
|
; Function Attrs: nounwind readnone
|
||
|
declare i64 @llvm.read_register.i64(metadata) #1
|
||
|
|
||
|
; Function Attrs: nounwind
|
||
|
declare void @llvm.write_register.i64(metadata, i64) #2
|
||
|
|
||
|
declare void @foo(...)
|
||
|
|
||
|
attributes #0 = { nounwind }
|
||
|
attributes #1 = { nounwind readnone }
|
||
|
attributes #2 = { nounwind }
|
||
|
|
||
|
!llvm.named.register.r1 = !{!0}
|
||
|
|
||
|
!0 = !{!"r1"}
|
||
|
|