1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-26 04:32:44 +01:00
llvm-mirror/test/Transforms/Mem2Reg/alloca_addrspace.ll
Johannes Doerfert e393443e6f [SROA][Mem2Reg] Do not crash on alloca + addrspacecast
SROA knows that it can look through addrspacecast but
PromoteMemoryToRegister did not handle them. This caused an assertion
error for the test case, exposed while running
`Transforms/PhaseOrdering/inlining-alignment-assumptions.ll` with D83978
applied.

Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D84085
2020-07-24 15:15:38 -05:00

20 lines
589 B
LLVM

; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt < %s -mem2reg -S | FileCheck %s
; RUN: opt < %s -passes=mem2reg -S | FileCheck %s
; Do not crash ;)
target datalayout = "e-p:64:64-p5:32:32-A5"
define amdgpu_kernel void @addressspace_alloca() {
; CHECK-LABEL: @addressspace_alloca(
; CHECK-NEXT: ret void
;
%alloca = alloca i8, align 8, addrspace(5)
%cast = addrspacecast i8 addrspace(5)* %alloca to i8*
call void @llvm.lifetime.start.p0i8(i64 2, i8* %cast)
ret void
}
declare void @llvm.lifetime.start.p0i8(i64 %size, i8* nocapture %ptr)