Skip to content

Commit c5d3d13

Browse files
committed
[DirectX] Remove llvm.assume intrinsic
fixes llvm#165051 This change reverts the experiment we did for llvm#165311 While some backends seem to support llvm.assume without validation The validator itself does not so it makes more sense to just remove it.
1 parent 260f9e9 commit c5d3d13

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

llvm/lib/Target/DirectX/DXILIntrinsicExpansion.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@ static Value *expand16BitIsNormal(CallInst *Orig) {
197197

198198
static bool isIntrinsicExpansion(Function &F) {
199199
switch (F.getIntrinsicID()) {
200+
case Intrinsic::assume:
200201
case Intrinsic::abs:
201202
case Intrinsic::atan2:
202203
case Intrinsic::exp:
@@ -988,6 +989,9 @@ static bool expandIntrinsic(Function &F, CallInst *Orig) {
988989
case Intrinsic::abs:
989990
Result = expandAbs(Orig);
990991
break;
992+
case Intrinsic::assume:
993+
Orig->eraseFromParent();
994+
return true;
991995
case Intrinsic::atan2:
992996
Result = expandAtan2Intrinsic(Orig);
993997
break;

llvm/lib/Target/DirectX/DXILOpLowering.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -904,8 +904,6 @@ 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:
909907
case Intrinsic::not_intrinsic:
910908
if (F.use_empty())
911909
F.eraseFromParent();
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
; RUN: opt -S -dxil-intrinsic-expansion -mtriple=dxil-pc-shadermodel6.3-library %s | FileCheck %s
2+
3+
define void @test_llvm_assume(i1 %0) {
4+
; CHECK-LABEL: test_llvm_assume
5+
; CHECK-NEXT: ret void
6+
tail call void @llvm.assume(i1 %0)
7+
ret void
8+
}
9+

llvm/test/tools/dxil-dis/llvm_assume.ll

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)