Skip to content

Commit 30b5ed3

Browse files
committed
Revert "AMDGPU: bump AS.MAX_COMMON_ADDRESS to 6 since 32-bit addr space"
As it introduces out of bound access. This reverts commit r340172 and r340171 llvm-svn: 340202
1 parent 94b9029 commit 30b5ed3

File tree

3 files changed

+2
-8
lines changed

3 files changed

+2
-8
lines changed

llvm/lib/Target/AMDGPU/AMDGPU.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ struct AMDGPUAS {
229229

230230
enum : unsigned {
231231
// The maximum value for flat, generic, local, private, constant and region.
232-
MAX_COMMON_ADDRESS = 6,
232+
MAX_COMMON_ADDRESS = 5,
233233

234234
GLOBAL_ADDRESS = 1, ///< Address space for global memory (RAT0, VTX0).
235235
CONSTANT_ADDRESS = 4, ///< Address space for constant memory (VTX2)

llvm/lib/Target/AMDGPU/AMDGPUAliasAnalysis.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ AMDGPUAAResult::ASAliasRulesTy::ASAliasRulesTy(AMDGPUAS AS_, Triple::ArchType Ar
6969
/* Region */ {MayAlias, NoAlias , NoAlias , NoAlias, MayAlias, NoAlias},
7070
/* Private */ {MayAlias, NoAlias , NoAlias , NoAlias , NoAlias , MayAlias}
7171
};
72-
static_assert(AMDGPUAS::MAX_COMMON_ADDRESS <= 6, "Addr space out of range");
72+
assert(AS.MAX_COMMON_ADDRESS <= 5);
7373
if (AS.FLAT_ADDRESS == 0) {
7474
assert(AS.GLOBAL_ADDRESS == 1 &&
7575
AS.REGION_ADDRESS == 2 &&

llvm/test/CodeGen/AMDGPU/amdgpu-alias-analysis.ll

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,3 @@ define void @test(i8 addrspace(5)* %p, i8 addrspace(1)* %p1) {
77
ret void
88
}
99

10-
; CHECK: NoAlias: i8 addrspace(1)* %p1, i8 addrspace(6)* %p
11-
12-
define void @test_32bit_addr_space(i8 addrspace(6)* %p, i8 addrspace(1)* %p1) {
13-
ret void
14-
}
15-

0 commit comments

Comments
 (0)