Files
derek.holloway 7502bf64a4
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
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

151 lines
4.9 KiB
LLVM

; RUN: opt -aa-pipeline=basic-aa -print-all-alias-modref-info -passes=aa-eval < %s 2>&1 | FileCheck %s
; RUN: opt -aa-pipeline=basic-aa -print-all-alias-modref-info -passes=aa-eval -use-dereferenceable-at-point-semantics < %s 2>&1 | FileCheck %s
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
@G = global i32 0, align 4
define i64 @global_and_deref_arg_1(ptr dereferenceable(8) %arg) nofree nosync {
; CHECK: Function: global_and_deref_arg_1: 2 pointers, 0 call sites
; CHECK-NEXT: NoAlias: i64* %arg, i32* @G
bb:
store i64 1, ptr %arg, align 8
store i32 0, ptr @G, align 4
%tmp = load i64, ptr %arg, align 8
ret i64 %tmp
}
define i32 @global_and_deref_arg_2(ptr dereferenceable(8) %arg) nofree nosync {
; CHECK: Function: global_and_deref_arg_2: 2 pointers, 0 call sites
; CHECK-NEXT: NoAlias: i32* %arg, i32* @G
bb:
store i32 1, ptr %arg, align 8
store i32 0, ptr @G, align 4
%tmp = load i32, ptr %arg, align 8
ret i32 %tmp
}
define i32 @byval_and_deref_arg_1(ptr byval(i32) %obj, ptr dereferenceable(8) %arg) nofree nosync {
; CHECK: Function: byval_and_deref_arg_1: 2 pointers, 0 call sites
; CHECK-NEXT: NoAlias: i64* %arg, i32* %obj
bb:
store i32 1, ptr %obj, align 4
store i64 0, ptr %arg, align 8
%tmp = load i32, ptr %obj, align 4
ret i32 %tmp
}
define i32 @byval_and_deref_arg_2(ptr byval(i32) %obj, ptr dereferenceable(8) %arg) nofree nosync {
; CHECK: Function: byval_and_deref_arg_2: 2 pointers, 0 call sites
; CHECK-NEXT: NoAlias: i32* %arg, i32* %obj
bb:
store i32 1, ptr %obj, align 4
store i32 0, ptr %arg, align 8
%tmp = load i32, ptr %obj, align 4
ret i32 %tmp
}
declare dereferenceable(8) ptr @get_i32_deref8()
declare dereferenceable(8) ptr @get_i64_deref8()
declare void @unknown(ptr)
define i32 @local_and_deref_ret_1() {
; CHECK: Function: local_and_deref_ret_1: 2 pointers, 2 call sites
; CHECK-NEXT: NoAlias: i32* %obj, i64* %ret
bb:
%obj = alloca i32
call void @unknown(ptr %obj)
%ret = call dereferenceable(8) ptr @get_i64_deref8()
store i32 1, ptr %obj, align 4
store i64 0, ptr %ret, align 8
%tmp = load i32, ptr %obj, align 4
ret i32 %tmp
}
define i32 @local_and_deref_ret_2() {
; CHECK: Function: local_and_deref_ret_2: 2 pointers, 2 call sites
; CHECK-NEXT: NoAlias: i32* %obj, i32* %ret
bb:
%obj = alloca i32
call void @unknown(ptr %obj)
%ret = call dereferenceable(8) ptr @get_i32_deref8()
store i32 1, ptr %obj, align 4
store i32 0, ptr %ret, align 8
%tmp = load i32, ptr %obj, align 4
ret i32 %tmp
}
; Baseline tests, same as above but with 2 instead of 8 dereferenceable bytes.
define i64 @global_and_deref_arg_non_deref_1(ptr dereferenceable(2) %arg) nofree nosync {
; CHECK: Function: global_and_deref_arg_non_deref_1: 2 pointers, 0 call sites
; CHECK-NEXT: NoAlias: i64* %arg, i32* @G
bb:
store i64 1, ptr %arg, align 8
store i32 0, ptr @G, align 4
%tmp = load i64, ptr %arg, align 8
ret i64 %tmp
}
define i32 @global_and_deref_arg_non_deref_2(ptr dereferenceable(2) %arg) nofree nosync {
; CHECK: Function: global_and_deref_arg_non_deref_2: 2 pointers, 0 call sites
; Different result than above (see @global_and_deref_arg_2).
; CHECK-NEXT: MayAlias: i32* %arg, i32* @G
bb:
store i32 1, ptr %arg, align 8
store i32 0, ptr @G, align 4
%tmp = load i32, ptr %arg, align 8
ret i32 %tmp
}
define i32 @byval_and_deref_arg_non_deref_1(ptr byval(i32) %obj, ptr dereferenceable(2) %arg) nofree nosync {
; CHECK: Function: byval_and_deref_arg_non_deref_1: 2 pointers, 0 call sites
; CHECK-NEXT: NoAlias: i64* %arg, i32* %obj
bb:
store i32 1, ptr %obj, align 4
store i64 0, ptr %arg, align 8
%tmp = load i32, ptr %obj, align 4
ret i32 %tmp
}
define i32 @byval_and_deref_arg_non_deref_2(ptr byval(i32) %obj, ptr dereferenceable(2) %arg) nofree nosync {
; CHECK: Function: byval_and_deref_arg_non_deref_2: 2 pointers, 0 call sites
; CHECK-NEXT: NoAlias: i32* %arg, i32* %obj
bb:
store i32 1, ptr %obj, align 4
store i32 0, ptr %arg, align 8
%tmp = load i32, ptr %obj, align 4
ret i32 %tmp
}
declare dereferenceable(2) ptr @get_i32_deref2()
declare dereferenceable(2) ptr @get_i64_deref2()
define i32 @local_and_deref_ret_non_deref_1() {
; CHECK: Function: local_and_deref_ret_non_deref_1: 2 pointers, 2 call sites
; CHECK-NEXT: NoAlias: i32* %obj, i64* %ret
bb:
%obj = alloca i32
call void @unknown(ptr %obj)
%ret = call dereferenceable(2) ptr @get_i64_deref2()
store i32 1, ptr %obj, align 4
store i64 0, ptr %ret, align 8
%tmp = load i32, ptr %obj, align 4
ret i32 %tmp
}
define i32 @local_and_deref_ret_non_deref_2() {
; CHECK: Function: local_and_deref_ret_non_deref_2: 2 pointers, 2 call sites
; Different result than above (see @local_and_deref_ret_2).
; CHECK-NEXT: MayAlias: i32* %obj, i32* %ret
bb:
%obj = alloca i32
call void @unknown(ptr %obj)
%ret = call dereferenceable(2) ptr @get_i32_deref2()
store i32 1, ptr %obj, align 4
store i32 0, ptr %ret, align 8
%tmp = load i32, ptr %obj, align 4
ret i32 %tmp
}