llvm.org GIT mirror llvm / 15cca40
Merging r258537: ------------------------------------------------------------------------ r258537 | Matthew.Arsenault | 2016-01-22 11:47:54 -0800 (Fri, 22 Jan 2016) | 6 lines AMDGPU: Fix crash with invariant markers The promote alloca pass didn't handle these intrinsics and crashed. These intrinsics should accept any address space, but for now just erase them to avoid breaking. ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_38@271484 91177308-0d34-0410-b5e6-96231b3b80d8 Tom Stellard 3 years ago
2 changed file(s) with 33 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
412412 Intr->eraseFromParent();
413413 continue;
414414 }
415 case Intrinsic::invariant_start:
416 case Intrinsic::invariant_end:
417 case Intrinsic::invariant_group_barrier:
418 Intr->eraseFromParent();
419 // FIXME: I think the invariant marker should still theoretically apply,
420 // but the intrinsics need to be changed to accept pointers with any
421 // address space.
422 continue;
415423 default:
416424 Intr->dump();
417425 llvm_unreachable("Don't know how to promote alloca intrinsic use.");
0 ; RUN: llc -march=amdgcn -mattr=+promote-alloca -verify-machineinstrs < %s | FileCheck -check-prefix=GCN %s
1
2 declare {}* @llvm.invariant.start(i64, i8* nocapture) #0
3 declare void @llvm.invariant.end({}*, i64, i8* nocapture) #0
4 declare i8* @llvm.invariant.group.barrier(i8*) #1
5
6 ; GCN-LABEL: {{^}}use_invariant_promotable_lds:
7 ; GCN: buffer_load_dword
8 ; GCN: ds_write_b32
9 define void @use_invariant_promotable_lds(i32 addrspace(1)* %arg) #2 {
10 bb:
11 %tmp = alloca i32, align 4
12 %tmp1 = bitcast i32* %tmp to i8*
13 %tmp2 = getelementptr inbounds i32, i32 addrspace(1)* %arg, i64 1
14 %tmp3 = load i32, i32 addrspace(1)* %tmp2
15 store i32 %tmp3, i32* %tmp
16 %tmp4 = call {}* @llvm.invariant.start(i64 4, i8* %tmp1) #0
17 call void @llvm.invariant.end({}* %tmp4, i64 4, i8* %tmp1) #0
18 %tmp5 = call i8* @llvm.invariant.group.barrier(i8* %tmp1) #1
19 ret void
20 }
21
22 attributes #0 = { argmemonly nounwind }
23 attributes #1 = { nounwind readnone }
24 attributes #2 = { nounwind }