Skip to content

Commit 20ba782

Browse files
authored
Ignore experimental_noalias_scope_decl intrinsic (#906)
Signed-off-by: Dmitry Sidorov <[email protected]>
1 parent 3f314d8 commit 20ba782

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

lib/SPIRV/SPIRVWriter.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -2118,6 +2118,7 @@ bool LLVMToSPIRV::isKnownIntrinsic(Intrinsic::ID Id) {
21182118
case Intrinsic::ctlz:
21192119
case Intrinsic::cttz:
21202120
case Intrinsic::expect:
2121+
case Intrinsic::experimental_noalias_scope_decl:
21212122
case Intrinsic::experimental_constrained_fadd:
21222123
case Intrinsic::experimental_constrained_fsub:
21232124
case Intrinsic::experimental_constrained_fmul:
@@ -2735,6 +2736,7 @@ SPIRVValue *LLVMToSPIRV::transIntrinsicInst(IntrinsicInst *II,
27352736
break;
27362737
}
27372738
// We can just ignore/drop some intrinsics, like optimizations hint.
2739+
case Intrinsic::experimental_noalias_scope_decl:
27382740
case Intrinsic::invariant_start:
27392741
case Intrinsic::invariant_end:
27402742
case Intrinsic::dbg_label:
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
; RUN: llvm-as %s -o %t.bc
2+
; RUN: llvm-spirv %t.bc -o %t.spv
3+
; RUN: llvm-spirv -r %t.spv -o %t.rev.bc
4+
; RUN: llvm-dis < %t.rev.bc | FileCheck %s
5+
6+
target datalayout = "e-p:32:32-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024"
7+
target triple = "spir-unknown-unknown"
8+
9+
; CHECK-NOT: llvm.experimental.noalias.scope.decl
10+
declare void @llvm.experimental.noalias.scope.decl(metadata)
11+
12+
; Function Attrs: nounwind
13+
define spir_kernel void @foo() {
14+
entry:
15+
call void @llvm.experimental.noalias.scope.decl(metadata !1)
16+
ret void
17+
}
18+
19+
!opencl.enable.FP_CONTRACT = !{}
20+
!opencl.spir.version = !{!2}
21+
!opencl.ocl.version = !{!2}
22+
!opencl.used.extensions = !{!3}
23+
!opencl.used.optional.core.features = !{!3}
24+
!opencl.compiler.options = !{!3}
25+
26+
!1 = !{!1}
27+
!2 = !{i32 1, i32 2}
28+
!3 = !{}

0 commit comments

Comments
 (0)