Update the EarlyCSE tests to use opaque pointers. Worth noting that this leaves some bitcast ptr to ptr instructions in the input IR behind which are no longer necessary. This is because these use numbered instructions, so it's hard to drop them in an automated fashion (as it would require renumbering all other instructions as well). I'm leaving that as a problem for another day. The test updates have been performed using https://gist.github.com/nikic/98357b71fd67756b0f064c9517b62a34. Differential Revision: https://reviews.llvm.org/D127278
36 lines
891 B
LLVM
36 lines
891 B
LLVM
; RUN: opt -S -early-cse -earlycse-debug-hash < %s | FileCheck %s
|
|
; RUN: opt -S -basic-aa -early-cse-memssa < %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 @foo()
|
|
%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"}
|
|
|