From dafb9926e5047a052ef5263dd4ec4fe5f178e5e0 Mon Sep 17 00:00:00 2001 From: Victor Mustya Date: Mon, 5 Dec 2022 22:20:32 +0000 Subject: [PATCH] Fix build together with LLVM-8 . --- .../include/llvmVCWrapper/IR/Instructions.h | 13 +++++++++++-- .../test/Adaptors/addr_conv_attribute_writer.ll | 1 - GenXIntrinsics/test/Adaptors/annot_mess_writer.ll | 1 - .../test/Adaptors/annotated_args_writer.ll | 1 - .../Adaptors/args_attributes_transform_writer.ll | 1 - .../test/Adaptors/combined_args_writer.ll | 1 - GenXIntrinsics/test/Adaptors/image_array_writer.ll | 1 - GenXIntrinsics/test/Adaptors/media_block_writer.ll | 1 - GenXIntrinsics/test/Adaptors/plain_args_writer.ll | 1 - .../test/Adaptors/surface_access_writer.ll | 1 - 10 files changed, 11 insertions(+), 11 deletions(-) diff --git a/GenXIntrinsics/include/llvmVCWrapper/IR/Instructions.h b/GenXIntrinsics/include/llvmVCWrapper/IR/Instructions.h index e371ab7d..51b5ea38 100644 --- a/GenXIntrinsics/include/llvmVCWrapper/IR/Instructions.h +++ b/GenXIntrinsics/include/llvmVCWrapper/IR/Instructions.h @@ -43,8 +43,17 @@ inline llvm::ArrayRef getShuffleMask(llvm::ArrayRef Mask, } // namespace ShuffleVectorInst -template -inline auto getValue(llvm::Optional &opt) { +template +inline ArgKind &getValue(llvm::Optional &opt) { +#if VC_INTR_LLVM_VERSION_MAJOR < 15 + return opt.getValue(); +#else + return opt.value(); +#endif +} + +template +inline const ArgKind &getValue(const llvm::Optional &opt) { #if VC_INTR_LLVM_VERSION_MAJOR < 15 return opt.getValue(); #else diff --git a/GenXIntrinsics/test/Adaptors/addr_conv_attribute_writer.ll b/GenXIntrinsics/test/Adaptors/addr_conv_attribute_writer.ll index 9b24c014..83b60c87 100644 --- a/GenXIntrinsics/test/Adaptors/addr_conv_attribute_writer.ll +++ b/GenXIntrinsics/test/Adaptors/addr_conv_attribute_writer.ll @@ -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( diff --git a/GenXIntrinsics/test/Adaptors/annot_mess_writer.ll b/GenXIntrinsics/test/Adaptors/annot_mess_writer.ll index 43ec3452..b175af26 100644 --- a/GenXIntrinsics/test/Adaptors/annot_mess_writer.ll +++ b/GenXIntrinsics/test/Adaptors/annot_mess_writer.ll @@ -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( diff --git a/GenXIntrinsics/test/Adaptors/annotated_args_writer.ll b/GenXIntrinsics/test/Adaptors/annotated_args_writer.ll index c6d99481..60b473a7 100644 --- a/GenXIntrinsics/test/Adaptors/annotated_args_writer.ll +++ b/GenXIntrinsics/test/Adaptors/annotated_args_writer.ll @@ -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( diff --git a/GenXIntrinsics/test/Adaptors/args_attributes_transform_writer.ll b/GenXIntrinsics/test/Adaptors/args_attributes_transform_writer.ll index 29300512..b4199aa4 100644 --- a/GenXIntrinsics/test/Adaptors/args_attributes_transform_writer.ll +++ b/GenXIntrinsics/test/Adaptors/args_attributes_transform_writer.ll @@ -10,7 +10,6 @@ ; UNSUPPORTED: llvm8 ; RUN: opt -S -GenXSPIRVWriterAdaptor < %s | FileCheck %s -; XFAIL: llvm16 ; CHECK: @test ; CHECK-SAME: i8 ; CHECK-SAME: byval(i8) diff --git a/GenXIntrinsics/test/Adaptors/combined_args_writer.ll b/GenXIntrinsics/test/Adaptors/combined_args_writer.ll index 2137489c..309fda65 100644 --- a/GenXIntrinsics/test/Adaptors/combined_args_writer.ll +++ b/GenXIntrinsics/test/Adaptors/combined_args_writer.ll @@ -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( diff --git a/GenXIntrinsics/test/Adaptors/image_array_writer.ll b/GenXIntrinsics/test/Adaptors/image_array_writer.ll index 4c4d0235..a10e447e 100644 --- a/GenXIntrinsics/test/Adaptors/image_array_writer.ll +++ b/GenXIntrinsics/test/Adaptors/image_array_writer.ll @@ -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( diff --git a/GenXIntrinsics/test/Adaptors/media_block_writer.ll b/GenXIntrinsics/test/Adaptors/media_block_writer.ll index d644167f..ee274ffb 100644 --- a/GenXIntrinsics/test/Adaptors/media_block_writer.ll +++ b/GenXIntrinsics/test/Adaptors/media_block_writer.ll @@ -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( diff --git a/GenXIntrinsics/test/Adaptors/plain_args_writer.ll b/GenXIntrinsics/test/Adaptors/plain_args_writer.ll index e2cc523e..7c9cfbe5 100644 --- a/GenXIntrinsics/test/Adaptors/plain_args_writer.ll +++ b/GenXIntrinsics/test/Adaptors/plain_args_writer.ll @@ -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( diff --git a/GenXIntrinsics/test/Adaptors/surface_access_writer.ll b/GenXIntrinsics/test/Adaptors/surface_access_writer.ll index 68ec09a6..4ff97ea7 100644 --- a/GenXIntrinsics/test/Adaptors/surface_access_writer.ll +++ b/GenXIntrinsics/test/Adaptors/surface_access_writer.ll @@ -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(