llvm-project/llvm/test/Transforms/OpenMP/keep_rpc_client.ll
Joseph Huber 4cb4516ae9 [OpenMP] Fix RPC client not being optimized out after changes
Summary:
I forgot that this check deliberately looked through the indirection I
removed. Fix it to just check if the symbol has no users.
2024-11-27 15:56:23 -06:00

41 lines
1.4 KiB
LLVM

; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-globals
; RUN: opt -S -passes=openmp-opt-postlink < %s | FileCheck %s --check-prefix=POSTLINK
; RUN: opt -S -passes=openmp-opt < %s | FileCheck %s --check-prefix=PRELINK
@__llvm_rpc_client = internal addrspace(1) global i64 zeroinitializer, align 8
;.
; PRELINK: @__llvm_rpc_client = internal addrspace(1) global i64 0, align 8
;.
define i64 @a() {
; POSTLINK-LABEL: define {{[^@]+}}@a
; POSTLINK-SAME: () #[[ATTR0:[0-9]+]] {
; POSTLINK-NEXT: ret i64 0
;
; PRELINK-LABEL: define {{[^@]+}}@a
; PRELINK-SAME: () #[[ATTR0:[0-9]+]] {
; PRELINK-NEXT: ret i64 0
;
%retval = load i64, ptr addrspace(1) @__llvm_rpc_client, align 8
ret i64 %retval
}
!llvm.module.flags = !{!0, !1, !2}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 7, !"openmp", i32 50}
!2 = !{i32 7, !"openmp-device", i32 50}
;.
; POSTLINK: attributes #[[ATTR0]] = { norecurse nosync }
;.
; PRELINK: attributes #[[ATTR0]] = { norecurse nosync }
;.
; POSTLINK: [[META0:![0-9]+]] = !{i32 1, !"wchar_size", i32 4}
; POSTLINK: [[META1:![0-9]+]] = !{i32 7, !"openmp", i32 50}
; POSTLINK: [[META2:![0-9]+]] = !{i32 7, !"openmp-device", i32 50}
;.
; PRELINK: [[META0:![0-9]+]] = !{i32 1, !"wchar_size", i32 4}
; PRELINK: [[META1:![0-9]+]] = !{i32 7, !"openmp", i32 50}
; PRELINK: [[META2:![0-9]+]] = !{i32 7, !"openmp-device", i32 50}
;.