Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions llvm/lib/Target/DirectX/DXILOpLowering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -753,6 +753,8 @@ class OpLowerer {
case Intrinsic::dx_resource_casthandle:
// NOTE: llvm.dbg.value is supported as is in DXIL.
case Intrinsic::dbg_value:
case Intrinsic::lifetime_start:
case Intrinsic::lifetime_end:
case Intrinsic::not_intrinsic:
continue;
default: {
Expand Down
18 changes: 18 additions & 0 deletions llvm/test/CodeGen/DirectX/legalize-lifetimes.ll
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
; RUN: opt -S -passes='dxil-op-lower' -mtriple=dxil-pc-shadermodel6.3-library %s | FileCheck %s

; CHECK-LABEL: define void @test_legal_lifetime() {
; CHECK-NEXT: [[ACCUM_I_FLAT:%.*]] = alloca [1 x i32], align 4
; CHECK-NEXT: [[GEP:%.*]] = getelementptr i32, ptr [[ACCUM_I_FLAT]], i32 0
; CHECK-NEXT: call void @llvm.lifetime.start.p0(i64 4, ptr nonnull [[ACCUM_I_FLAT]])
; CHECK-NEXT: store i32 0, ptr [[GEP]], align 4
; CHECK-NEXT: call void @llvm.lifetime.end.p0(i64 4, ptr nonnull [[ACCUM_I_FLAT]])
; CHECK-NEXT: ret void
;
define void @test_legal_lifetime() {
%accum.i.flat = alloca [1 x i32], align 4
%gep = getelementptr i32, ptr %accum.i.flat, i32 0
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %accum.i.flat)
store i32 0, ptr %gep, align 4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %accum.i.flat)
ret void
}
Loading