Files
clang-p2996/llvm/test/CodeGen/AMDGPU/amdgpu-alias-analysis.ll
Samuel Pitoiset 7bd9dcffcd AMDGPU: bump AS.MAX_COMMON_ADDRESS to 6 since 32-bit addr space
32-bit constant address space is declared as 6, so the
maximum number of address spaces is 6, not 5.

Fixes "LLVM ERROR: Pointer address space out of range".

v5: rename MAX_COMMON_ADDRESS to MAX_AMDGPU_ADDRESS
v4: - fix compilation issues
    - fix out of bounds access
v3: use static_assert()
v2: add a very simple test for 32-bit addr space

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=106630
llvm-svn: 340417
2018-08-22 16:08:48 +00:00

34 lines
1.0 KiB
LLVM

; RUN: opt -mtriple=amdgcn-- -O3 -aa-eval -print-all-alias-modref-info -disable-output < %s 2>&1 | FileCheck %s
; RUN: opt -mtriple=r600-- -O3 -aa-eval -print-all-alias-modref-info -disable-output < %s 2>&1 | FileCheck %s
; CHECK: NoAlias: i8 addrspace(1)* %p1, i8 addrspace(5)* %p
define void @test(i8 addrspace(5)* %p, i8 addrspace(1)* %p1) {
ret void
}
; CHECK: MayAlias: i8 addrspace(1)* %p1, i8 addrspace(4)* %p
define void @test_constant_vs_global(i8 addrspace(4)* %p, i8 addrspace(1)* %p1) {
ret void
}
; CHECK: MayAlias: i8 addrspace(1)* %p, i8 addrspace(4)* %p1
define void @test_global_vs_constant(i8 addrspace(1)* %p, i8 addrspace(4)* %p1) {
ret void
}
; CHECK: MayAlias: i8 addrspace(1)* %p1, i8 addrspace(6)* %p
define void @test_constant_32bit_vs_global(i8 addrspace(6)* %p, i8 addrspace(1)* %p1) {
ret void
}
; CHECK: MayAlias: i8 addrspace(4)* %p1, i8 addrspace(6)* %p
define void @test_constant_32bit_vs_constant(i8 addrspace(6)* %p, i8 addrspace(4)* %p1) {
ret void
}