AMDGPU: bump AS.MAX_COMMON_ADDRESS to 6 since 32-bit addr space
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Wed, 22 Aug 2018 16:08:48 +0000 (16:08 +0000)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Wed, 22 Aug 2018 16:08:48 +0000 (16:08 +0000)
commit7bd9dcffcdf33b190151cd5979e9578822cf78ab
tree997485ce8aff3b287f35e76988aadb6aae44a077
parentd81d6f7d5898120462b433fa121348e3be525f85
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
llvm/lib/Target/AMDGPU/AMDGPU.h
llvm/lib/Target/AMDGPU/AMDGPUAliasAnalysis.cpp
llvm/lib/Target/AMDGPU/AMDGPUAliasAnalysis.h
llvm/test/CodeGen/AMDGPU/amdgpu-alias-analysis.ll