CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
84 lines
3.5 KiB
LLVM
84 lines
3.5 KiB
LLVM
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 6
|
|
; RUN: opt -passes=gvn -S < %s | FileCheck %s
|
|
|
|
%struct.t = type { ptr }
|
|
|
|
; The loaded address and the location of the address itself are not aliased,
|
|
; so the second reload is not necessary. Check that it can be eliminated.
|
|
define void @test1(ptr nocapture readonly %p, i32 %v) #0 {
|
|
; CHECK-LABEL: define void @test1(
|
|
; CHECK-SAME: ptr readonly captures(none) [[P:%.*]], i32 [[V:%.*]]) #[[ATTR0:[0-9]+]] {
|
|
; CHECK-NEXT: [[ENTRY:.*:]]
|
|
; CHECK-NEXT: [[TMP0:%.*]] = load ptr, ptr [[P]], align 4, !tbaa [[ANYPTR_TBAA0:![0-9]+]]
|
|
; CHECK-NEXT: store volatile i32 [[V]], ptr [[TMP0]], align 4, !tbaa [[INT_TBAA5:![0-9]+]]
|
|
; CHECK-NEXT: store volatile i32 [[V]], ptr [[TMP0]], align 4, !tbaa [[INT_TBAA5]]
|
|
; CHECK-NEXT: ret void
|
|
;
|
|
entry:
|
|
%0 = load ptr, ptr %p, align 4, !tbaa !1
|
|
store volatile i32 %v, ptr %0, align 4, !tbaa !6
|
|
%1 = load ptr, ptr %p, align 4, !tbaa !1
|
|
store volatile i32 %v, ptr %1, align 4, !tbaa !6
|
|
ret void
|
|
}
|
|
|
|
; The store via the loaded address may overwrite the address itself.
|
|
; Make sure that both loads remain.
|
|
define void @test2(ptr nocapture readonly %p, i32 %v) #0 {
|
|
; CHECK-LABEL: define void @test2(
|
|
; CHECK-SAME: ptr readonly captures(none) [[P:%.*]], i32 [[V:%.*]]) #[[ATTR0]] {
|
|
; CHECK-NEXT: [[ENTRY:.*:]]
|
|
; CHECK-NEXT: [[TMP0:%.*]] = load ptr, ptr [[P]], align 4, !tbaa [[ANYPTR_TBAA0]]
|
|
; CHECK-NEXT: store volatile i32 [[V]], ptr [[TMP0]], align 4, !tbaa [[ANYPTR_TBAA0]]
|
|
; CHECK-NEXT: [[TMP1:%.*]] = load ptr, ptr [[P]], align 4, !tbaa [[ANYPTR_TBAA0]]
|
|
; CHECK-NEXT: store volatile i32 [[V]], ptr [[TMP1]], align 4, !tbaa [[ANYPTR_TBAA0]]
|
|
; CHECK-NEXT: ret void
|
|
;
|
|
entry:
|
|
%0 = load ptr, ptr %p, align 4, !tbaa !1
|
|
store volatile i32 %v, ptr %0, align 4, !tbaa !1
|
|
%1 = load ptr, ptr %p, align 4, !tbaa !1
|
|
store volatile i32 %v, ptr %1, align 4, !tbaa !1
|
|
ret void
|
|
}
|
|
|
|
; The loads are ordered and non-monotonic. Although they are not aliased to
|
|
; the stores, make sure both are preserved.
|
|
define void @test3(ptr nocapture readonly %p, i32 %v) #0 {
|
|
; CHECK-LABEL: define void @test3(
|
|
; CHECK-SAME: ptr readonly captures(none) [[P:%.*]], i32 [[V:%.*]]) #[[ATTR0]] {
|
|
; CHECK-NEXT: [[ENTRY:.*:]]
|
|
; CHECK-NEXT: [[TMP0:%.*]] = load atomic ptr, ptr [[P]] acquire, align 4, !tbaa [[ANYPTR_TBAA0]]
|
|
; CHECK-NEXT: store volatile i32 [[V]], ptr [[TMP0]], align 4, !tbaa [[INT_TBAA5]]
|
|
; CHECK-NEXT: [[TMP1:%.*]] = load atomic ptr, ptr [[P]] acquire, align 4, !tbaa [[ANYPTR_TBAA0]]
|
|
; CHECK-NEXT: store volatile i32 [[V]], ptr [[TMP1]], align 4, !tbaa [[INT_TBAA5]]
|
|
; CHECK-NEXT: ret void
|
|
;
|
|
entry:
|
|
%0 = load atomic ptr, ptr %p acquire, align 4, !tbaa !1
|
|
store volatile i32 %v, ptr %0, align 4, !tbaa !6
|
|
%1 = load atomic ptr, ptr %p acquire, align 4, !tbaa !1
|
|
store volatile i32 %v, ptr %1, align 4, !tbaa !6
|
|
ret void
|
|
}
|
|
|
|
attributes #0 = { norecurse nounwind }
|
|
|
|
!1 = !{!2, !3, i64 0}
|
|
!2 = !{!"", !3, i64 0}
|
|
!3 = !{!"any pointer", !4, i64 0}
|
|
!4 = !{!"omnipotent char", !5, i64 0}
|
|
!5 = !{!"Simple C/C++ TBAA"}
|
|
!6 = !{!7, !7, i64 0}
|
|
!7 = !{!"int", !4, i64 0}
|
|
|
|
;.
|
|
; CHECK: [[ANYPTR_TBAA0]] = !{[[META1:![0-9]+]], [[META2:![0-9]+]], i64 0}
|
|
; CHECK: [[META1]] = !{!"", [[META2]], i64 0}
|
|
; CHECK: [[META2]] = !{!"any pointer", [[META3:![0-9]+]], i64 0}
|
|
; CHECK: [[META3]] = !{!"omnipotent char", [[META4:![0-9]+]], i64 0}
|
|
; CHECK: [[META4]] = !{!"Simple C/C++ TBAA"}
|
|
; CHECK: [[INT_TBAA5]] = !{[[META6:![0-9]+]], [[META6]], i64 0}
|
|
; CHECK: [[META6]] = !{!"int", [[META3]], i64 0}
|
|
;.
|