diff options
author | Matt Arsenault <Matthew.Arsenault@amd.com> | 2022-12-02 19:22:54 -0500 |
---|---|---|
committer | Matt Arsenault <Matthew.Arsenault@amd.com> | 2022-12-16 14:24:03 -0500 |
commit | bf67186bd2a1dcd042219dca408a56ddd06ee16d (patch) | |
tree | 1e8baa02fff6357cc5332882cdcea4e32ccd3e72 /llvm/test/Analysis/CallGraph/llvm-used.ll | |
parent | 714301d784308c74724ab30ea566fa14fc01d300 (diff) | |
download | llvm-bf67186bd2a1dcd042219dca408a56ddd06ee16d.zip llvm-bf67186bd2a1dcd042219dca408a56ddd06ee16d.tar.gz llvm-bf67186bd2a1dcd042219dca408a56ddd06ee16d.tar.bz2 |
Function: Respect IgnoreLLVMUsed with addrspacecasted functions
Try to respect IgnoreLLVMUsed if the function was addrspacecasted to
match llvm.used's type.
Diffstat (limited to 'llvm/test/Analysis/CallGraph/llvm-used.ll')
-rw-r--r-- | llvm/test/Analysis/CallGraph/llvm-used.ll | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/llvm/test/Analysis/CallGraph/llvm-used.ll b/llvm/test/Analysis/CallGraph/llvm-used.ll index 9f0df15..738a42d 100644 --- a/llvm/test/Analysis/CallGraph/llvm-used.ll +++ b/llvm/test/Analysis/CallGraph/llvm-used.ll @@ -8,6 +8,7 @@ ; CHECK: Call graph node <<null function>><<{{.*}}>> #uses=0 ; CHECK-NEXT: CS<None> calls function 'used1' ; CHECK-NEXT: CS<None> calls function 'used2' +; CHECK-NEXT: CS<None> calls function 'used_addrspace1' ; CHECK-NEXT: CS<None> calls function 'unused' ; CHECK-EMPTY: ; CHECK-NEXT: Call graph node for function: 'unused'<<{{.*}}>> #uses=1 @@ -16,8 +17,10 @@ ; CHECK-EMPTY: ; CHECK-NEXT: Call graph node for function: 'used2'<<{{.*}}>> #uses=1 ; CHECK-EMPTY: +; CHECK-NEXT: Call graph node for function: 'used_addrspace1'<<{{.*}}>> #uses=1 +; CHECK-EMPTY: -@llvm.used = appending global [1 x ptr] [ptr @used1] +@llvm.used = appending global [2 x ptr] [ptr @used1, ptr addrspacecast (ptr addrspace(1) @used_addrspace1 to ptr)] @llvm.compiler.used = appending global [1 x ptr] [ptr @used2] @array = appending global [1 x ptr] [ptr @unused] @@ -31,6 +34,11 @@ entry: ret void } +define internal void @used_addrspace1() addrspace(1) { +entry: + ret void +} + define internal void @unused() { entry: ret void |