[llvm] r340171 - AMDGPU: bump AS.MAX_COMMON_ADDRESS to 6 since 32-bit addr space

Samuel Pitoiset via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 20 12:35:13 PDT 2018


Thanks!

On 8/20/18 9:32 PM, Vitaly Buka wrote:
> Reverted both with r340202
> 
> On Mon, Aug 20, 2018 at 12:26 PM Samuel Pitoiset 
> <samuel.pitoiset at gmail.com <mailto:samuel.pitoiset at gmail.com>> wrote:
> 
>     You will need to revert r340172 too because it fixes compilation issues
>     reported by buildbot. If you think it will be easier, feel free to
>     revert both.
> 
>     On 8/20/18 9:22 PM, Vitaly Buka wrote:
>      > Wound it be easier just revert and reland correct patch?
>      > Also easier to backport it to other LLVM version as a single patch.
>      >
>      > On Mon, Aug 20, 2018 at 12:08 PM Samuel Pitoiset
>      > <samuel.pitoiset at gmail.com <mailto:samuel.pitoiset at gmail.com>
>     <mailto:samuel.pitoiset at gmail.com
>     <mailto:samuel.pitoiset at gmail.com>>> wrote:
>      >
>      >     This should be fixed by https://reviews.llvm.org/D50974
>      >
>      >     Sorry for the breakage and please don't revert it, I guess a
>     fix should
>      >     be upstream soon.
>      >
>      >     Thanks!
>      >
>      >     On 8/20/18 8:36 PM, Vitaly Buka wrote:
>      >      > Not sure how this suppose to work.
>      >      > Now MAX_COMMON_ADDRESS allows to have AS1 and AS2 == 6
>      >      > and (*ASAliasRules)[AS1][AS2].
>      >      > but ASAliasRulesPrivIsZero and ASAliasRulesGenIsZero had
>     only 6
>      >     elements
>      >      >
>      >      > If no one is looking, I am going to revert.
>      >      >
>      >      > On Mon, Aug 20, 2018 at 11:24 AM Vitaly Buka
>      >     <vitalybuka at google.com <mailto:vitalybuka at google.com>
>     <mailto:vitalybuka at google.com <mailto:vitalybuka at google.com>>
>      >      > <mailto:vitalybuka at google.com
>     <mailto:vitalybuka at google.com> <mailto:vitalybuka at google.com
>     <mailto:vitalybuka at google.com>>>> wrote:
>      >      >
>      >      >     Similar for msan
>      >      >
>      >
>     http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-bootstrap-msan/builds/6784
>      >      >     and ubsan
>      >      >
>      >
>     http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-bootstrap-ubsan/builds/5631/steps/check-llvm%20ubsan/logs/stdio
>      >      >
>      >      >     On Mon, Aug 20, 2018 at 11:22 AM Vitaly Buka
>      >     <vitalybuka at google.com <mailto:vitalybuka at google.com>
>     <mailto:vitalybuka at google.com <mailto:vitalybuka at google.com>>
>      >      >     <mailto:vitalybuka at google.com
>     <mailto:vitalybuka at google.com>
>      >     <mailto:vitalybuka at google.com
>     <mailto:vitalybuka at google.com>>>> wrote:
>      >      >
>      >      >         This looks caused by the patch
>      >      >
>      >
>     http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-bootstrap/builds/6883/steps/check-llvm%20asan/logs/stdio
>      >      >
>      >      >         FAIL: LLVM :: CodeGen/AMDGPU/amdgpu-alias-analysis.ll
>      >     (5325 of
>      >      >         27229) ******************** TEST 'LLVM ::
>      >      >         CodeGen/AMDGPU/amdgpu-alias-analysis.ll' FAILED
>      >      >         ******************** Script: -- : 'RUN: at line 1';
>      >      >
>      >     
>       /b/sanitizer-x86_64-linux-bootstrap/build/llvm_build_asan/bin/opt
>      >     -mtriple=amdgcn--
>      >      >         -O3 -aa-eval -print-all-alias-modref-info
>     -disable-output <
>      >      >
>      >     
>       /b/sanitizer-x86_64-linux-bootstrap/build/llvm/test/CodeGen/AMDGPU/amdgpu-alias-analysis.ll
>      >      >         2>&1 |
>      >      >
>      >     
>       /b/sanitizer-x86_64-linux-bootstrap/build/llvm_build_asan/bin/FileCheck
>      >      >
>      >     
>       /b/sanitizer-x86_64-linux-bootstrap/build/llvm/test/CodeGen/AMDGPU/amdgpu-alias-analysis.ll
>      >      >         : 'RUN: at line 2';
>      >      >
>      >     
>       /b/sanitizer-x86_64-linux-bootstrap/build/llvm_build_asan/bin/opt
>      >     -mtriple=r600--
>      >      >         -O3 -aa-eval -print-all-alias-modref-info
>     -disable-output <
>      >      >
>      >     
>       /b/sanitizer-x86_64-linux-bootstrap/build/llvm/test/CodeGen/AMDGPU/amdgpu-alias-analysis.ll
>      >      >         2>&1 |
>      >      >
>      >     
>       /b/sanitizer-x86_64-linux-bootstrap/build/llvm_build_asan/bin/FileCheck
>      >      >
>      >     
>       /b/sanitizer-x86_64-linux-bootstrap/build/llvm/test/CodeGen/AMDGPU/amdgpu-alias-analysis.ll
>      >      >         -- Exit Code: 1 Command Output (stderr): --
>      >      >
>      >     
>       /b/sanitizer-x86_64-linux-bootstrap/build/llvm/test/CodeGen/AMDGPU/amdgpu-alias-analysis.ll:10:10:
>      >      >         error: CHECK: expected string not found in input ;
>     CHECK:
>      >      >         NoAlias: i8 addrspace(1)* %p1, i8 addrspace(6)* %p ^
>      >      >         <stdin>:3:1: note: scanning from here Function:
>      >      >         test_32bit_addr_space: 2 pointers, 0 call sites ^
>      >     <stdin>:3:5:
>      >      >         note: possible intended match here Function:
>      >      >         test_32bit_addr_space: 2 pointers, 0 call sites ^ --
>      >      >         ******************** Testing: 0 .. 10.. 20 FAIL:
>     LLVM ::
>      >      >         CodeGen/AMDGPU/widen-smrd-loads.ll (6391 of 27229)
>      >      >         ******************** TEST 'LLVM ::
>      >      >         CodeGen/AMDGPU/widen-smrd-loads.ll' FAILED
>      >     ********************
>      >      >         Script: -- : 'RUN: at line 1';
>      >      >
>      >     
>       /b/sanitizer-x86_64-linux-bootstrap/build/llvm_build_asan/bin/llc
>      >     -amdgpu-codegenprepare-widen-constant-loads=0
>      >      >         -march=amdgcn -mcpu=tahiti -verify-machineinstrs <
>      >      >
>      >     
>       /b/sanitizer-x86_64-linux-bootstrap/build/llvm/test/CodeGen/AMDGPU/widen-smrd-loads.ll
>      >      >         |
>      >      >
>      >     
>       /b/sanitizer-x86_64-linux-bootstrap/build/llvm_build_asan/bin/FileCheck
>      >      >         -enable-var-scope -check-prefixes=GCN,SI
>      >      >
>      >     
>       /b/sanitizer-x86_64-linux-bootstrap/build/llvm/test/CodeGen/AMDGPU/widen-smrd-loads.ll
>      >      >         : 'RUN: at line 2';
>      >      >
>      >     
>       /b/sanitizer-x86_64-linux-bootstrap/build/llvm_build_asan/bin/llc
>      >     -amdgpu-codegenprepare-widen-constant-loads=0
>      >      >         -march=amdgcn -mcpu=tonga -verify-machineinstrs <
>      >      >
>      >     
>       /b/sanitizer-x86_64-linux-bootstrap/build/llvm/test/CodeGen/AMDGPU/widen-smrd-loads.ll
>      >      >         |
>      >      >
>      >     
>       /b/sanitizer-x86_64-linux-bootstrap/build/llvm_build_asan/bin/FileCheck
>      >      >         -enable-var-scope -check-prefixes=GCN,VI
>      >      >
>      >     
>       /b/sanitizer-x86_64-linux-bootstrap/build/llvm/test/CodeGen/AMDGPU/widen-smrd-loads.ll
>      >      >         -- Exit Code: 1 Command Output (stderr): --
>      >      >
>      >     
>       =================================================================
>      >     ==22327==ERROR:
>      >      >         AddressSanitizer: global-buffer-overflow on address
>      >      >         0x000007134b68 at pc 0x0000012c05c8 bp
>     0x7fff2e2b6b40 sp
>      >      >         0x7fff2e2b6b38 READ of size 1 at 0x000007134b68
>     thread T0 #0
>      >      >         0x12c05c7 in getAliasResult
>      >      >
>      >     
>       /b/sanitizer-x86_64-linux-bootstrap/build/llvm/lib/Target/AMDGPU/AMDGPUAliasAnalysis.cpp:99:10
>      >      >         #1 0x12c05c7 in
>      >     llvm::AMDGPUAAResult::alias(llvm::MemoryLocation
>      >      >         const&, llvm::MemoryLocation const&)
>      >      >
>      >     
>       /b/sanitizer-x86_64-linux-bootstrap/build/llvm/lib/Target/AMDGPU/AMDGPUAliasAnalysis.cpp:107
>      >      >         #2 0x3367dc1 in
>     llvm::AAResults::alias(llvm::MemoryLocation
>      >      >         const&, llvm::MemoryLocation const&)
>      >      >
>      >     
>       /b/sanitizer-x86_64-linux-bootstrap/build/llvm/lib/Analysis/AliasAnalysis.cpp:105:23
>      >      >         #3 0x3396a90 in alias
>      >      >
>      >     
>       /b/sanitizer-x86_64-linux-bootstrap/build/llvm/include/llvm/Analysis/AliasAnalysis.h:896:25
>      >      >         #4 0x3396a90 in
>     llvm::BasicAAResult::aliasCheck(llvm::Value
>      >      >         const*, unsigned long, llvm::AAMDNodes,
>     llvm::Value const*,
>      >      >         unsigned long, llvm::AAMDNodes, llvm::Value const*,
>      >     llvm::Value
>      >      >         const*)
>      >      >
>      >     
>       /b/sanitizer-x86_64-linux-bootstrap/build/llvm/lib/Analysis/BasicAliasAnalysis.cpp:1779
>      >      >         #5 0x33951de in
>      >     llvm::BasicAAResult::alias(llvm::MemoryLocation
>      >      >         const&, llvm::MemoryLocation const&)
>      >      >
>      >     
>       /b/sanitizer-x86_64-linux-bootstrap/build/llvm/lib/Analysis/BasicAliasAnalysis.cpp:780:23
>      >      >         #6 0x3367dc1 in
>     llvm::AAResults::alias(llvm::MemoryLocation
>      >      >         const&, llvm::MemoryLocation const&)
>      >      >
>      >     
>       /b/sanitizer-x86_64-linux-bootstrap/build/llvm/lib/Analysis/AliasAnalysis.cpp:105:23
>      >      >         #7 0x35d070c in
>      >      >
>      >     
>       llvm::MemoryDependenceResults::getSimplePointerDependencyFrom(llvm::MemoryLocation
>      >      >         const&, bool,
>      >      >
>      >     
>       llvm::ilist_iterator<llvm::ilist_detail::node_options<llvm::Instruction,
>      >      >         true, false, void>, false, false>, llvm::BasicBlock*,
>      >      >         llvm::Instruction*, unsigned int*)
>      >      >
>      >     
>       /b/sanitizer-x86_64-linux-bootstrap/build/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp:577:26
>      >      >         #8 0x35cfb45 in
>      >      >
>      >     
>       llvm::MemoryDependenceResults::getSimplePointerDependencyFrom(llvm::MemoryLocation
>      >      >         const&, bool,
>      >      >
>      >     
>       llvm::ilist_iterator<llvm::ilist_detail::node_options<llvm::Instruction,
>      >      >         true, false, void>, false, false>, llvm::BasicBlock*,
>      >      >         llvm::Instruction*, unsigned int*)
>      >      >
>      >     
>       /b/sanitizer-x86_64-linux-bootstrap/build/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp:448:12
>      >      >         #9 0x35ce759 in
>      >      >
>      >     
>       llvm::MemoryDependenceResults::getPointerDependencyFrom(llvm::MemoryLocation
>      >      >         const&, bool,
>      >      >
>      >     
>       llvm::ilist_iterator<llvm::ilist_detail::node_options<llvm::Instruction,
>      >      >         true, false, void>, false, false>, llvm::BasicBlock*,
>      >      >         llvm::Instruction*, unsigned int*)
>      >      >
>      >     
>       /b/sanitizer-x86_64-linux-bootstrap/build/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp:341:28
>      >      >         #10 0x12c95d4 in isClobberedInFunction
>      >      >
>      >     
>       /b/sanitizer-x86_64-linux-bootstrap/build/llvm/lib/Target/AMDGPU/AMDGPUAnnotateUniformValues.cpp:112:19
>      >      >         #11 0x12c95d4 in visitLoadInst
>      >      >
>      >     
>       /b/sanitizer-x86_64-linux-bootstrap/build/llvm/lib/Target/AMDGPU/AMDGPUAnnotateUniformValues.cpp:142
>      >      >         #12 0x12c95d4 in visitLoad
>      >      >
>      >     
>       /b/sanitizer-x86_64-linux-bootstrap/build/llvm/include/llvm/IR/Instruction.def:153
>      >      >         #13 0x12c95d4 in visit
>      >      >
>      >     
>       /b/sanitizer-x86_64-linux-bootstrap/build/llvm/include/llvm/IR/Instruction.def:153
>      >      >         #14 0x12c95d4 in
>      >      >
>      >     
>       visit<llvm::ilist_iterator<llvm::ilist_detail::node_options<llvm::Instruction,
>      >      >         true, false, void>, false, false> >
>      >      >
>      >     
>       /b/sanitizer-x86_64-linux-bootstrap/build/llvm/include/llvm/IR/InstVisitor.h:92
>      >      >         #15 0x12c95d4 in visit
>      >      >
>      >     
>       /b/sanitizer-x86_64-linux-bootstrap/build/llvm/include/llvm/IR/InstVisitor.h:107
>      >      >         #16 0x12c95d4 in
>      >      >
>      >     
>       visit<llvm::ilist_iterator<llvm::ilist_detail::node_options<llvm::BasicBlock,
>      >      >         true, false, void>, false, false> >
>      >      >
>      >     
>       /b/sanitizer-x86_64-linux-bootstrap/build/llvm/include/llvm/IR/InstVisitor.h:92
>      >      >         #17 0x12c95d4 in visit
>      >      >
>      >     
>       /b/sanitizer-x86_64-linux-bootstrap/build/llvm/include/llvm/IR/InstVisitor.h:103
>      >      >         #18 0x12c95d4 in (anonymous
>      >      >
>      >     
>       namespace)::AMDGPUAnnotateUniformValues::runOnFunction(llvm::Function&)
>      >      >
>      >     
>       /b/sanitizer-x86_64-linux-bootstrap/build/llvm/lib/Target/AMDGPU/AMDGPUAnnotateUniformValues.cpp:184
>      >      >         #19 0x47fea6d in
>      >      >         llvm::FPPassManager::runOnFunction(llvm::Function&)
>      >      >
>      >     
>       /b/sanitizer-x86_64-linux-bootstrap/build/llvm/lib/IR/LegacyPassManager.cpp:1586:27
>      >      >         #20 0x3464f8c in RunPassOnSCC
>      >      >
>      >     
>       /b/sanitizer-x86_64-linux-bootstrap/build/llvm/lib/Analysis/CallGraphSCCPass.cpp:166:25
>      >      >         #21 0x3464f8c in RunAllPassesOnSCC
>      >      >
>      >     
>       /b/sanitizer-x86_64-linux-bootstrap/build/llvm/lib/Analysis/CallGraphSCCPass.cpp:430
>      >      >         #22 0x3464f8c in (anonymous
>      >      >         namespace)::CGPassManager::runOnModule(llvm::Module&)
>      >      >
>      >     
>       /b/sanitizer-x86_64-linux-bootstrap/build/llvm/lib/Analysis/CallGraphSCCPass.cpp:486
>      >      >         #23 0x47ffe7e in runOnModule
>      >      >
>      >     
>       /b/sanitizer-x86_64-linux-bootstrap/build/llvm/lib/IR/LegacyPassManager.cpp:1669:27
>      >      >         #24 0x47ffe7e in
>      >      >         llvm::legacy::PassManagerImpl::run(llvm::Module&)
>      >      >
>      >     
>       /b/sanitizer-x86_64-linux-bootstrap/build/llvm/lib/IR/LegacyPassManager.cpp:1774
>      >      >         #25 0xa074af in compileModule(char**,
>     llvm::LLVMContext&)
>      >      >
>      >     
>       /b/sanitizer-x86_64-linux-bootstrap/build/llvm/tools/llc/llc.cpp:597:8
>      >      >         #26 0xa00ae0 in main
>      >      >
>      >     
>       /b/sanitizer-x86_64-linux-bootstrap/build/llvm/tools/llc/llc.cpp:351:22
>      >      >         #27 0x7f33f66c22e0 in __libc_start_main
>      >      >         (/lib/x86_64-linux-gnu/libc.so.6+0x202e0) #28
>     0x8f4b99 in
>      >     _start
>      >      >
>      >     
>       (/b/sanitizer-x86_64-linux-bootstrap/build/llvm_build_asan/bin/llc+0x8f4b99)
>      >      >         0x000007134b68 is located 56 bytes to the left of
>     global
>      >      >         variable '<string literal>' defined in
>      >      >
>      >     
>       '/b/sanitizer-x86_64-linux-bootstrap/build/llvm/lib/Target/AMDGPU/AMDGPUAliasAnalysis.cpp:74:5'
>      >      >         (0x7134ba0) of size 129 '<string literal>' is
>     ascii string
>      >      >         'AS.GLOBAL_ADDRESS == 1 && AS.REGION_ADDRESS == 2 &&
>      >      >         AS.LOCAL_ADDRESS == 3 && AS.CONSTANT_ADDRESS == 4 &&
>      >      >         AS.PRIVATE_ADDRESS == 5' 0x000007134b68 is located
>     4 bytes to
>      >      >         the right of global variable 'ASAliasRulesGenIsZero'
>      >     defined in
>      >      >
>      >     
>       '/b/sanitizer-x86_64-linux-bootstrap/build/llvm/lib/Target/AMDGPU/AMDGPUAliasAnalysis.cpp:63:28'
>      >      >         (0x7134b40) of size 36 SUMMARY: AddressSanitizer:
>      >      >         global-buffer-overflow
>      >      >
>      >     
>       /b/sanitizer-x86_64-linux-bootstrap/build/llvm/lib/Target/AMDGPU/AMDGPUAliasAnalysis.cpp:99:10
>      >      >         in getAliasResult Shadow bytes around the buggy
>     address:
>      >      >         0x000080e1e910: 00 00 00 00 00 00 00 00 00 07 f9
>     f9 f9 f9
>      >     f9 f9
>      >      >         0x000080e1e920: 00 00 00 00 00 00 00 01 f9 f9 f9
>     f9 00 00
>      >     00 00
>      >      >         0x000080e1e930: 00 00 00 00 00 00 00 00 00 00 00
>     00 00 00
>      >     00 00
>      >      >         0x000080e1e940: f9 f9 f9 f9 00 00 00 00 00 03 f9
>     f9 f9 f9
>      >     f9 f9
>      >      >         0x000080e1e950: 00 00 00 00 00 00 04 f9 f9 f9 f9
>     f9 00 00
>      >     00 00
>      >      >         =>0x000080e1e960: 00 00 00 00 00 00 00 00 00 00 00 00
>      >     04[f9]f9
>      >      >         f9 0x000080e1e970: f9 f9 f9 f9 00 00 00 00 00 00
>     00 00 00
>      >     00 00
>      >      >         00 0x000080e1e980: 00 00 00 00 01 f9 f9 f9 f9 f9
>     f9 f9 00
>      >     00 00
>      >      >         00 0x000080e1e990: 00 00 00 00 00 00 00 01 f9 f9
>     f9 f9 00
>      >     00 00
>      >      >         00 0x000080e1e9a0: 00 00 00 00 00 00 01 f9 f9 f9
>     f9 f9 00
>      >     00 00
>      >      >         00 0x000080e1e9b0: 00 00 00 00 00 00 00 00 00 00
>     00 00 00
>      >     00 00
>      >      >         01 Shadow byte legend (one shadow byte represents 8
>      >     application
>      >      >         bytes): Addressable: 00 Partially addressable: 01
>     02 03
>      >     04 05 06
>      >      >         07 Heap left redzone: fa Freed heap region: fd
>     Stack left
>      >      >         redzone: f1 Stack mid redzone: f2 Stack right
>     redzone: f3
>      >     Stack
>      >      >         after return: f5 Stack use after scope: f8 Global
>     redzone: f9
>      >      >         Global init order: f6 Poisoned by user: f7 Container
>      >     overflow:
>      >      >         fc Array cookie: ac Intra object redzone: bb ASan
>      >     internal: fe
>      >      >         Left alloca redzone: ca Right alloca redzone: cb
>     Shadow
>      >     gap: cc
>      >      >         ==22327==ABORTING
>      >      >
>      >     
>       /b/sanitizer-x86_64-linux-bootstrap/build/llvm/test/CodeGen/AMDGPU/widen-smrd-loads.ll:143:14:
>      >      >         error: GCN-LABEL: expected string not found in input ;
>      >      >         GCN-LABEL: {{^}}widen_i16_constant32_load: ^
>     <stdin>:518:37:
>      >      >         note: scanning from here
>      >     widen_i1_zext_to_i64_constant_load: ;
>      >      >         @widen_i1_zext_to_i64_constant_load ^
>     <stdin>:518:48: note:
>      >      >         possible intended match here
>      >     widen_i1_zext_to_i64_constant_load:
>      >      >         ; @widen_i1_zext_to_i64_constant_load ^ --
>      >     ********************
>      >      >         Testing: 0 .. 10.. 20.. 30.. 40.. 50.. 60.. 70..
>     80.. 90..
>      >      >         Testing Time: 384.24s ******************** Failing
>     Tests (2):
>      >      >         LLVM :: CodeGen/AMDGPU/amdgpu-alias-analysis.ll
>     LLVM ::
>      >      >         CodeGen/AMDGPU/widen-smrd-loads.ll Expected Passes
>     : 26393
>      >      >         Expected Failures : 148 Unsupported Tests : 686
>     Unexpected
>      >      >         Failures: 2 FAILED: test/CMakeFiles/check-llvm cd
>      >      >
>      >       /b/sanitizer-x86_64-linux-bootstrap/build/llvm_build_asan/test
>      >      >         && /usr/bin/python2.7
>      >      >
>      >     
>       /b/sanitizer-x86_64-linux-bootstrap/build/llvm_build_asan/./bin/llvm-lit
>      >      >         -sv
>      >      >
>      >       /b/sanitizer-x86_64-linux-bootstrap/build/llvm_build_asan/test
>      >      >         ninja: build stopped: subcommand failed. + echo
>      >      >         @@@STEP_FAILURE@@@ + echo @@@BUILD_STEP
>     check-clang asan@@@
>      >      >         @@@STEP_FAILURE@@@
>      >      >
>      >     
>       --------------------------------------------------------------------------------
>      >      >         started: Mon Aug 20 06:50:07 2018 ended: Mon Aug
>     20 07:15:07
>      >      >         2018 duration: 24 mins, 59 secs
>      >      >
>      >      >
>      >      >         On Mon, Aug 20, 2018 at 6:19 AM Samuel Pitoiset via
>      >     llvm-commits
>      >      >         <llvm-commits at lists.llvm.org
>     <mailto:llvm-commits at lists.llvm.org>
>      >     <mailto:llvm-commits at lists.llvm.org
>     <mailto:llvm-commits at lists.llvm.org>>
>      >      >         <mailto:llvm-commits at lists.llvm.org
>     <mailto:llvm-commits at lists.llvm.org>
>      >     <mailto:llvm-commits at lists.llvm.org
>     <mailto:llvm-commits at lists.llvm.org>>>> wrote:
>      >      >
>      >      >             Author: hakzsam
>      >      >             Date: Mon Aug 20 06:18:59 2018
>      >      >             New Revision: 340171
>      >      >
>      >      >             URL:
>      > http://llvm.org/viewvc/llvm-project?rev=340171&view=rev
>      >      >             Log:
>      >      >             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".
>      >      >
>      >      >             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
>      >      >             Signed-off-by: Samuel Pitoiset
>      >     <samuel.pitoiset at gmail.com <mailto:samuel.pitoiset at gmail.com>
>     <mailto:samuel.pitoiset at gmail.com <mailto:samuel.pitoiset at gmail.com>>
>      >      >             <mailto:samuel.pitoiset at gmail.com
>     <mailto:samuel.pitoiset at gmail.com>
>      >     <mailto:samuel.pitoiset at gmail.com
>     <mailto:samuel.pitoiset at gmail.com>>>>
>      >      >
>      >      >             Modified:
>      >      >                  llvm/trunk/lib/Target/AMDGPU/AMDGPU.h
>      >      >                 
>     llvm/trunk/lib/Target/AMDGPU/AMDGPUAliasAnalysis.cpp
>      >      >
>      >     llvm/trunk/test/CodeGen/AMDGPU/amdgpu-alias-analysis.ll
>      >      >
>      >      >             Modified: llvm/trunk/lib/Target/AMDGPU/AMDGPU.h
>      >      >             URL:
>      >      >
>      >
>     http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AMDGPU/AMDGPU.h?rev=340171&r1=340170&r2=340171&view=diff
>      >      >
>      >     
>       ==============================================================================
>      >      >             --- llvm/trunk/lib/Target/AMDGPU/AMDGPU.h
>     (original)
>      >      >             +++ llvm/trunk/lib/Target/AMDGPU/AMDGPU.h Mon
>     Aug 20
>      >      >             06:18:59 2018
>      >      >             @@ -229,7 +229,7 @@ struct AMDGPUAS {
>      >      >
>      >      >                 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)
>      >      >
>      >      >             Modified:
>      >     llvm/trunk/lib/Target/AMDGPU/AMDGPUAliasAnalysis.cpp
>      >      >             URL:
>      >      >
>      >
>     http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AMDGPU/AMDGPUAliasAnalysis.cpp?rev=340171&r1=340170&r2=340171&view=diff
>      >      >
>      >     
>       ==============================================================================
>      >      >             ---
>     llvm/trunk/lib/Target/AMDGPU/AMDGPUAliasAnalysis.cpp
>      >      >             (original)
>      >      >             +++
>      >     llvm/trunk/lib/Target/AMDGPU/AMDGPUAliasAnalysis.cpp Mon
>      >      >             Aug 20 06:18:59 2018
>      >      >             @@ -69,7 +69,7 @@
>      >     AMDGPUAAResult::ASAliasRulesTy::ASAliasR
>      >      >                 /* 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 &&
>      >      >
>      >      >             Modified:
>      >      >           
>       llvm/trunk/test/CodeGen/AMDGPU/amdgpu-alias-analysis.ll
>      >      >             URL:
>      >      >
>      >
>     http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/AMDGPU/amdgpu-alias-analysis.ll?rev=340171&r1=340170&r2=340171&view=diff
>      >      >
>      >     
>       ==============================================================================
>      >      >             ---
>      >     llvm/trunk/test/CodeGen/AMDGPU/amdgpu-alias-analysis.ll
>      >      >             (original)
>      >      >             +++
>      >     llvm/trunk/test/CodeGen/AMDGPU/amdgpu-alias-analysis.ll
>      >      >             Mon Aug 20 06:18:59 2018
>      >      >             @@ -7,3 +7,9 @@ define void @test(i8
>     addrspace(5)* %p, i
>      >      >                 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
>      >      >             +}
>      >      >             +
>      >      >
>      >      >
>      >      >             _______________________________________________
>      >      >             llvm-commits mailing list
>      >      > llvm-commits at lists.llvm.org
>     <mailto:llvm-commits at lists.llvm.org>
>     <mailto:llvm-commits at lists.llvm.org
>     <mailto:llvm-commits at lists.llvm.org>>
>      >     <mailto:llvm-commits at lists.llvm.org
>     <mailto:llvm-commits at lists.llvm.org>
>      >     <mailto:llvm-commits at lists.llvm.org
>     <mailto:llvm-commits at lists.llvm.org>>>
>      >      > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>      >      >
>      >
> 


More information about the llvm-commits mailing list