Home | History | Annotate | Download | only in AMDGPU
      1 ; RUN: opt -mtriple=amdgcn-- -load-store-vectorizer -S -o - %s | FileCheck %s
      2 
      3 @lds = internal addrspace(3) global [512 x float] undef, align 4
      4 
      5 ; The original load has an implicit alignment of 4, and should not
      6 ; increase to an align 8 load.
      7 
      8 ; CHECK-LABEL: @load_keep_base_alignment_missing_align(
      9 ; CHECK: load <2 x float>, <2 x float> addrspace(3)* %{{[0-9]+}}, align 4
     10 define void @load_keep_base_alignment_missing_align(float addrspace(1)* %out) {
     11   %ptr0 = getelementptr inbounds [512 x float], [512 x float] addrspace(3)* @lds, i32 0, i32 11
     12   %val0 = load float, float addrspace(3)* %ptr0
     13 
     14   %ptr1 = getelementptr inbounds [512 x float], [512 x float] addrspace(3)* @lds, i32 0, i32 12
     15   %val1 = load float, float addrspace(3)* %ptr1
     16   %add = fadd float %val0, %val1
     17   store float %add, float addrspace(1)* %out
     18   ret void
     19 }
     20 
     21 
     22 ; CHECK-LABEL: @store_keep_base_alignment_missing_align(
     23 ; CHECK: store <2 x float> zeroinitializer, <2 x float> addrspace(3)* %{{[0-9]+}}, align 4
     24 define void @store_keep_base_alignment_missing_align() {
     25   %arrayidx0 = getelementptr inbounds [512 x float], [512 x float] addrspace(3)* @lds, i32 0, i32 1
     26   %arrayidx1 = getelementptr inbounds [512 x float], [512 x float] addrspace(3)* @lds, i32 0, i32 2
     27   store float 0.0, float addrspace(3)* %arrayidx0
     28   store float 0.0, float addrspace(3)* %arrayidx1
     29   ret void
     30 }
     31