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
4 changes: 4 additions & 0 deletions llvm/lib/Target/DirectX/DXILIntrinsicExpansion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ static Value *expand16BitIsNormal(CallInst *Orig) {

static bool isIntrinsicExpansion(Function &F) {
switch (F.getIntrinsicID()) {
case Intrinsic::assume:
case Intrinsic::abs:
case Intrinsic::atan2:
case Intrinsic::exp:
Expand Down Expand Up @@ -988,6 +989,9 @@ static bool expandIntrinsic(Function &F, CallInst *Orig) {
case Intrinsic::abs:
Result = expandAbs(Orig);
break;
case Intrinsic::assume:
Orig->eraseFromParent();
return true;
case Intrinsic::atan2:
Result = expandAtan2Intrinsic(Orig);
break;
Expand Down
2 changes: 0 additions & 2 deletions llvm/lib/Target/DirectX/DXILOpLowering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -904,8 +904,6 @@ class OpLowerer {
case Intrinsic::dx_resource_casthandle:
// NOTE: llvm.dbg.value is supported as is in DXIL.
case Intrinsic::dbg_value:
// NOTE: llvm.assume is supported as is in DXIL.
case Intrinsic::assume:
case Intrinsic::not_intrinsic:
if (F.use_empty())
F.eraseFromParent();
Expand Down
9 changes: 9 additions & 0 deletions llvm/test/CodeGen/DirectX/llvm_assume.ll
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
; RUN: opt -S -dxil-intrinsic-expansion -mtriple=dxil-pc-shadermodel6.3-library %s | FileCheck %s

define void @test_llvm_assume(i1 %0) {
; CHECK-LABEL: test_llvm_assume
; CHECK-NEXT: ret void
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: would CHECK-NOT llvm.assume be more clear?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking next would be better in the event someone comes along later and makes a transformation for llvm.assume. A transformation should break this test. Causing someone to come here and consider why they are doing a transformation but check-not would pass a transformation.

tail call void @llvm.assume(i1 %0)
ret void
}

11 changes: 0 additions & 11 deletions llvm/test/tools/dxil-dis/llvm_assume.ll

This file was deleted.