1 ; RUN: llc -march=amdgcn -mcpu=gfx900 < %s | FileCheck --check-prefix=GCN %s
3 ; This is used to crash due to mismatch of MMO target flags when folding
4 ; a LOAD SDNodes with different flags.
6 ; GCN-LABEL: {{^}}test_load_folding_mmo_flags:
7 ; GCN: global_load_dwordx2
8 define amdgpu_kernel void @test_load_folding_mmo_flags(ptr addrspace(1) %arg) {
10 %id = tail call i32 @llvm.amdgcn.workitem.id.x()
11 %arrayidx = getelementptr inbounds <2 x float>, ptr addrspace(1) %arg, i32 %id
12 %i3 = load float, ptr addrspace(1) %arrayidx, align 4
13 %idx = getelementptr inbounds <2 x float>, ptr addrspace(1) %arrayidx, i64 0, i32 1
14 %i4 = load float, ptr addrspace(1) %idx, align 4
15 %i5 = load i64, ptr addrspace(1) %arrayidx, align 4, !amdgpu.noclobber !0
16 store i64 %i5, ptr addrspace(1) undef, align 4
17 %mul = fmul float %i3, %i4
18 store float %mul, ptr addrspace(1) undef, align 4
22 declare i32 @llvm.amdgcn.workitem.id.x()