Skip to content

Commit

Permalink
Fix build together with LLVM-8
Browse files Browse the repository at this point in the history
 .
  • Loading branch information
vmustya authored and sys-cmllvm committed Dec 5, 2022
1 parent 782fbf7 commit dafb992
Show file tree
Hide file tree
Showing 10 changed files with 11 additions and 11 deletions.
13 changes: 11 additions & 2 deletions GenXIntrinsics/include/llvmVCWrapper/IR/Instructions.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,17 @@ inline llvm::ArrayRef<int> getShuffleMask(llvm::ArrayRef<int> Mask,

} // namespace ShuffleVectorInst

template<class ArgKind>
inline auto getValue(llvm::Optional<ArgKind> &opt) {
template <class ArgKind>
inline ArgKind &getValue(llvm::Optional<ArgKind> &opt) {
#if VC_INTR_LLVM_VERSION_MAJOR < 15
return opt.getValue();
#else
return opt.value();
#endif
}

template <class ArgKind>
inline const ArgKind &getValue(const llvm::Optional<ArgKind> &opt) {
#if VC_INTR_LLVM_VERSION_MAJOR < 15
return opt.getValue();
#else
Expand Down
1 change: 0 additions & 1 deletion GenXIntrinsics/test/Adaptors/addr_conv_attribute_writer.ll
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
; Test @llvm.genx.address.convert intrinsic generation with proper attributes

; RUN: opt -S -GenXSPIRVWriterAdaptor < %s | FileCheck %s
; XFAIL: llvm16

define void @test(i32 %buf) {
; CHECK-LABEL: @test(
Expand Down
1 change: 0 additions & 1 deletion GenXIntrinsics/test/Adaptors/annot_mess_writer.ll
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
; annotation should be matched.

; RUN: opt -S -GenXSPIRVWriterAdaptor < %s | FileCheck %s
; XFAIL: llvm16

define void @test(i32 %im2d, i32 %samp, i64 %ptr, i32 %gen) {
; CHECK-LABEL: @test(
Expand Down
1 change: 0 additions & 1 deletion GenXIntrinsics/test/Adaptors/annotated_args_writer.ll
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

; RUN: opt -S -GenXSPIRVWriterAdaptor < %s | FileCheck %s
; RUN: opt -S -GenXSPIRVWriterAdaptor -GenXSPIRVWriterAdaptor < %s | FileCheck %s
; XFAIL: llvm16

define void @test(i32 %buf, i32 %im1d, i32 %im1db, i32 %im2d, i32 %im3d, i32 %samp, i64 %ptr, <4 x i32> %gen) {
; CHECK-LABEL: @test(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

; UNSUPPORTED: llvm8
; RUN: opt -S -GenXSPIRVWriterAdaptor < %s | FileCheck %s
; XFAIL: llvm16
; CHECK: @test
; CHECK-SAME: i8
; CHECK-SAME: byval(i8)
Expand Down
1 change: 0 additions & 1 deletion GenXIntrinsics/test/Adaptors/combined_args_writer.ll
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

; RUN: opt -S -GenXSPIRVWriterAdaptor < %s | FileCheck %s
; RUN: opt -S -GenXSPIRVWriterAdaptor -GenXSPIRVWriterAdaptor < %s | FileCheck %s
; XFAIL: llvm16

define void @test(i32 %in, i32 %out, <3 x i32> %__arg_llvm.genx.local.id) {
; CHECK-LABEL: @test(
Expand Down
1 change: 0 additions & 1 deletion GenXIntrinsics/test/Adaptors/image_array_writer.ll
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
; Test writer translation of image array arguments.

; RUN: opt -S -GenXSPIRVWriterAdaptor < %s | FileCheck %s
; XFAIL: llvm16

define void @test(i32 %im1darr, i32 %im2darr) {
; CHECK-LABEL: @test(
Expand Down
1 change: 0 additions & 1 deletion GenXIntrinsics/test/Adaptors/media_block_writer.ll
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
; Test writer translation of media block images arguments.

; RUN: opt -S -GenXSPIRVWriterAdaptor < %s | FileCheck %s
; XFAIL: llvm16

define void @test(i32 %image) {
; CHECK-LABEL: @test(
Expand Down
1 change: 0 additions & 1 deletion GenXIntrinsics/test/Adaptors/plain_args_writer.ll
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

; RUN: opt -S -GenXSPIRVWriterAdaptor < %s | FileCheck %s
; RUN: opt -S -GenXSPIRVWriterAdaptor -GenXSPIRVWriterAdaptor < %s | FileCheck %s
; XFAIL: llvm16

define spir_kernel void @test(i32 %surf, i32 %samp, i64 %ptr, i32 %gen) {
; CHECK-LABEL: @test(
Expand Down
1 change: 0 additions & 1 deletion GenXIntrinsics/test/Adaptors/surface_access_writer.ll
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
; understand. This test checks access qualifiers translation.

; RUN: opt -S -GenXSPIRVWriterAdaptor < %s | FileCheck %s
; XFAIL: llvm16

define void @test(i32 %buf, i32 %im1d, i32 %im1db, i32 %im2d, i32 %im3d) {
; CHECK-LABEL: @test(
Expand Down

0 comments on commit dafb992

Please sign in to comment.