1 ; RUN: llc -march=amdgcn -mcpu=gfx900 -amdgpu-atomic-optimizations=true < %s | FileCheck %s
2 ; RUN: llc -march=amdgcn -mcpu=gfx900 -amdgpu-atomic-optimizations=true < %s -use-gpu-divergence-analysis | FileCheck %s
4 @local = addrspace(3) global i32 undef
6 define amdgpu_kernel void @reducible(i32 %x) {
7 ; CHECK-LABEL: reducible:
12 %i = phi i32 [ 0, %entry ], [ %i1, %loop ]
13 %gep = getelementptr i32, i32 addrspace(3)* @local, i32 %i
14 %cond = icmp ult i32 %i, %x
16 br i1 %cond, label %loop, label %exit
18 %old = atomicrmw add i32 addrspace(3)* %gep, i32 %x acq_rel