xref: /llvm-project/llvm/test/Transforms/SROA/vector-lifetime-intrinsic.ll (revision 4f7e5d22060e8a89237ffb93c3e7be6e92fee8fe)
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2; RUN: opt -passes='sroa<preserve-cfg>' -S < %s | FileCheck %s --check-prefixes=CHECK,CHECK-PRESERVE-CFG
3; RUN: opt -passes='sroa<modify-cfg>' -S < %s | FileCheck %s --check-prefixes=CHECK,CHECK-MODIFY-CFG
4
5target datalayout = "e-p:64:32-i64:32-v32:32-n32-S64"
6
7; Function Attrs: nounwind
8declare void @llvm.lifetime.start.p0(i64, ptr nocapture) #0
9
10; Function Attrs: nounwind
11declare void @llvm.lifetime.end.p0(i64, ptr nocapture) #0
12
13define void @wombat(<4 x float> %arg1) {
14; CHECK-LABEL: @wombat(
15; CHECK-NEXT:  bb:
16; CHECK-NEXT:    [[TMP_0_VEC_EXTRACT:%.*]] = shufflevector <4 x float> [[ARG1:%.*]], <4 x float> poison, <3 x i32> <i32 0, i32 1, i32 2>
17; CHECK-NEXT:    call void @wombat3(<3 x float> [[TMP_0_VEC_EXTRACT]])
18; CHECK-NEXT:    ret void
19;
20bb:
21  %tmp = alloca <4 x float>, align 16
22  call void @llvm.lifetime.start.p0(i64 16, ptr %tmp)
23  store <4 x float> %arg1, ptr %tmp, align 16
24  %tmp18 = load <3 x float>, ptr %tmp
25  call void @llvm.lifetime.end.p0(i64 16, ptr %tmp)
26  call void @wombat3(<3 x float> %tmp18)
27  ret void
28}
29
30; Function Attrs: nounwind
31declare void @wombat3(<3 x float>) #0
32
33attributes #0 = { nounwind }
34;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line:
35; CHECK-MODIFY-CFG: {{.*}}
36; CHECK-PRESERVE-CFG: {{.*}}
37