Index: lib/Target/AMDGPU/AMDGPU.h =================================================================== --- lib/Target/AMDGPU/AMDGPU.h +++ lib/Target/AMDGPU/AMDGPU.h @@ -229,7 +229,7 @@ enum : unsigned { // The maximum value for flat, generic, local, private, constant and region. - MAX_COMMON_ADDRESS = 5, + MAX_COMMON_ADDRESS = 6, GLOBAL_ADDRESS = 1, ///< Address space for global memory (RAT0, VTX0). CONSTANT_ADDRESS = 4, ///< Address space for constant memory (VTX2) Index: lib/Target/AMDGPU/AMDGPUAliasAnalysis.cpp =================================================================== --- lib/Target/AMDGPU/AMDGPUAliasAnalysis.cpp +++ lib/Target/AMDGPU/AMDGPUAliasAnalysis.cpp @@ -69,7 +69,7 @@ /* Region */ {MayAlias, NoAlias , NoAlias , NoAlias, MayAlias, NoAlias}, /* Private */ {MayAlias, NoAlias , NoAlias , NoAlias , NoAlias , MayAlias} }; - assert(AS.MAX_COMMON_ADDRESS <= 5); + static_assert(AS.MAX_COMMON_ADDRESS <= 6, "Addr space out of range"); if (AS.FLAT_ADDRESS == 0) { assert(AS.GLOBAL_ADDRESS == 1 && AS.REGION_ADDRESS == 2 && Index: test/CodeGen/AMDGPU/amdgpu-alias-analysis.ll =================================================================== --- test/CodeGen/AMDGPU/amdgpu-alias-analysis.ll +++ test/CodeGen/AMDGPU/amdgpu-alias-analysis.ll @@ -7,3 +7,9 @@ ret void } +; CHECK: NoAlias: i8 addrspace(1)* %p1, i8 addrspace(6)* %p + +define void @test_32bit_addr_space(i8 addrspace(6)* %p, i8 addrspace(1)* %p1) { + ret void +} +