brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.3 KiB · af7a19a Raw
37 lines · plain
1; RUN: llc --filetype=obj %s -o - | dxil-dis -o - | FileCheck %s2target triple = "dxil-unknown-shadermodel6.7-library"3 4define void @test_lifetimes()  {5; CHECK-LABEL: test_lifetimes6; CHECK-NEXT: [[ALLOCA:%.*]] = alloca [2 x i32], align 47; CHECK-NEXT: [[BITCAST:%.*]] = bitcast [2 x i32]* [[ALLOCA]] to i8*8; CHECK-NEXT: call void @llvm.lifetime.start(i64 8, i8* nonnull [[BITCAST]])9; CHECK-NEXT: [[BITCAST:%.*]] = bitcast [2 x i32]* [[ALLOCA]] to i8*10; CHECK-NEXT: call void @llvm.lifetime.end(i64 8, i8* nonnull [[BITCAST]])11; CHECK-NEXT: ret void12;13  %a = alloca [2 x i32], align 414  %gep = getelementptr [2 x i32], ptr %a, i32 0, i32 015  call void @llvm.lifetime.start.p0(ptr nonnull %a)16  store i32 0, ptr %gep, align 417  call void @llvm.lifetime.end.p0(ptr nonnull %a)18  ret void19}20 21; CHECK-DAG: attributes [[LIFETIME_ATTRS:#.*]] = { nounwind }22 23; CHECK-DAG: ; Function Attrs: nounwind24; CHECK-DAG: declare void @llvm.lifetime.start(i64, i8* nocapture) [[LIFETIME_ATTRS]]25 26; CHECK-DAG: ; Function Attrs: nounwind27; CHECK-DAG: declare void @llvm.lifetime.end(i64, i8* nocapture) [[LIFETIME_ATTRS]]28 29; Function Attrs: nounwind memory(argmem: readwrite)30declare void @llvm.lifetime.end.p0(ptr) #031 32; Function Attrs: nounwind memory(argmem: readwrite)33declare void @llvm.lifetime.start.p0(ptr) #034 35attributes #0 = { nounwind memory(argmem: readwrite) }36 37