Skip to content

Commit 9cb2ac7

Browse files
farzonlLukacma
authored andcommitted
[DirectX] Allow llvm.assume intrinsic to pass on to DXIL (llvm#165311)
fixes llvm#165051 Change is just to let the assume intrinsic pass on unmodified. Test is to confirm the DXIL disassembler doesn't blow up whe we generate DXIL with this intrinsic.
1 parent d6ce466 commit 9cb2ac7

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

llvm/lib/Target/DirectX/DXILOpLowering.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -904,6 +904,8 @@ class OpLowerer {
904904
case Intrinsic::dx_resource_casthandle:
905905
// NOTE: llvm.dbg.value is supported as is in DXIL.
906906
case Intrinsic::dbg_value:
907+
// NOTE: llvm.assume is supported as is in DXIL.
908+
case Intrinsic::assume:
907909
case Intrinsic::not_intrinsic:
908910
if (F.use_empty())
909911
F.eraseFromParent();
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
; RUN: llc --filetype=obj %s -o - | dxil-dis -o - | FileCheck %s
2+
3+
target triple = "dxil-pc-shadermodel6.7-library"
4+
5+
define void @test_llvm_assume(i1 %0) {
6+
; CHECK-LABEL: test_llvm_assume
7+
; CHECK-NEXT: tail call void @llvm.assume(i1 %0)
8+
tail call void @llvm.assume(i1 %0)
9+
ret void
10+
}
11+

0 commit comments

Comments
 (0)