summaryrefslogtreecommitdiff
path: root/dev-util/intel-graphics-compiler
diff options
context:
space:
mode:
Diffstat (limited to 'dev-util/intel-graphics-compiler')
-rw-r--r--dev-util/intel-graphics-compiler/Manifest6
-rw-r--r--dev-util/intel-graphics-compiler/files/intel-graphics-compiler-1.0.11485-fix-BiF-caching.patch49
-rw-r--r--dev-util/intel-graphics-compiler/files/intel-graphics-compiler-1.0.11485-include-opencl-c.patch11
-rw-r--r--dev-util/intel-graphics-compiler/files/intel-graphics-compiler-1.0.11485-update-raytracing-llvm14.patch186
-rw-r--r--dev-util/intel-graphics-compiler/files/intel-graphics-compiler-1.0.11485-wrap-getNumArgOperands.patch24
-rw-r--r--dev-util/intel-graphics-compiler/intel-graphics-compiler-1.0.11485.ebuild88
6 files changed, 364 insertions, 0 deletions
diff --git a/dev-util/intel-graphics-compiler/Manifest b/dev-util/intel-graphics-compiler/Manifest
index 9d15038f3882..f9aa5368afbb 100644
--- a/dev-util/intel-graphics-compiler/Manifest
+++ b/dev-util/intel-graphics-compiler/Manifest
@@ -1,6 +1,12 @@
+AUX intel-graphics-compiler-1.0.11485-fix-BiF-caching.patch 2303 BLAKE2B 3b1e50d823e7e6a95ec9b1dcdc0042a1890e9de1e7e2896ad8505d13fec301f62f7561d0556e5ae46361a0b81925f5fad95a40dfd72c847b9ff97e0e1c529906 SHA512 e9819bea36b88c6615ccc9eed1ff924afc0a7a560d7368a18f815f5dc02b60deced7536d4423bd02355d6e16ac2d91042c8662d8cabf8ed35ab6d099d3a4cc42
+AUX intel-graphics-compiler-1.0.11485-include-opencl-c.patch 507 BLAKE2B 1a777971e4db95a7ac719944f8533d7cb045e2092c452af35c2d5fd7e696ec848ed4777e9653f77627e4ca0fe36f4beffc9a39e3c7a13bda7973af6722238857 SHA512 8aaef1aaf0a6cedcd66e55ee8df0d89d40f3827b28243cc434dbbcadb568d8c1317a0968b57ad0b2a88de4479023a00b1b3b9a65fd34105cebe56fdeb3c30f1b
+AUX intel-graphics-compiler-1.0.11485-update-raytracing-llvm14.patch 8551 BLAKE2B 378e3ffd95097be18b090da1eca2b01f0333e7818cdefd8fe66c92b210bf49c6c85eb5a1a2cfc5c3a76da098ce3cc215df2f0f6faee5c2057cc3912029f4aa12 SHA512 826804a622b29dbf04ba54ced86da7e09d130842975a4381d29261b450d2615de273e9648c289d200e03cd67f8781467b439a4b542dc26ae04120838e0dee790
+AUX intel-graphics-compiler-1.0.11485-wrap-getNumArgOperands.patch 1046 BLAKE2B 1452cb35b9b198e7f7425bc9eb98603173f2c0984ee6a27d32750341699103f15d289ceffcc6e48c9165575e9e1f8d019911555b1bbd16cf967491f637a44501 SHA512 9bdf30a3de62b3da217a76f0f2e25929a3db538851f6ae807a568ffd740a160cb8f8a908ad22d026662c41bffee5b5c418d5d2e3f8f46cb565fa529f9d5bbf7c
AUX intel-graphics-compiler-1.0.8173-opencl-clang_version.patch 1807 BLAKE2B ec6aac8c78d7584e043a258585cbae6218fd8aa167d853e1eea96313298df7347ab7652ec2bf83199129e07e534d52fcd200858036e3d0af2c4f79ff249104f2 SHA512 1a0db341aab280aa205965dfc82d17b29f681bde76932f8291243afad985523f601c7279b1fb772ebc4d9197e5016941a1ad07cea2b6d7199710a7ee22fd81dc
AUX intel-graphics-compiler-1.0.8365-disable-git.patch 1140 BLAKE2B f870def1128c30c3e50a71e9eac39eccbcc9bc798be574324016c6c31ed3a3f82e1499f1aada5a2c475bd6b6c467b1b236635fdd6b5145904bc63dc53f8d75e5 SHA512 d1d53a6f4a47031ec4cdcf3f57c059536ccf571a72929da3d9070487686f91f4202d20c4d626da616250f66b31815b61fafa82b903b1f5157a226ee748097bda
AUX intel-graphics-compiler-1.0.9-no_Werror.patch 272 BLAKE2B 079fe334413dfddb7681940f2a8920a365e8e72526cfc09ea1c7d218e8b19468f80ea9a215be125b441ee5238d7856b8dec02ebfc4bfd76b1850aa9917da35ef SHA512 d3d27943e84e228b480172b4fe91ba9aed8bb1c98700eb8c8beebafb7f1cc6265279031f56181e67eff74f55e1bbc8ee24bdc4d14fc1200c5aff670ef019410d
DIST intel-graphics-compiler-1.0.11378.tar.gz 8809420 BLAKE2B d503b962193daf3731864739bc0efb753baed3603795e04941d17dcdcaf9e971787ffa877e8295054de41d889a39e2bdbf8119fb7d60110580acea3c24cefc58 SHA512 f3daedfe36badfe07f187b38c9a4da98116533940f4d910fbbd060813aeb1e3ffaa627a72180e66736748830a80cfca4c2a6dc9c8e9507884629e3e55add1cbb
+DIST intel-graphics-compiler-1.0.11485.tar.gz 8831925 BLAKE2B 7e2bcb37b4c34bb01788a8d75fc42498223b6193421cb726c21ce7949181757a10d112ae151736cd9283ba6ed8f0625597fb1f2a61229a7352e7f1f5ec34d1d0 SHA512 03fb571fdd61daea3a5c61ff75a146bd98b9b92dfd8bc1957143fe127977f5111df680ac86769d3c1fa1801ba2012b600b1ff844b318ce64460f2d042c4ae65b
EBUILD intel-graphics-compiler-1.0.11378.ebuild 2328 BLAKE2B 11f86a5068c3aee12e4eb5b2c9dce8a18a0bfc3e3b9d0ce6b1d40461a3f35ca76689e0ebc34587f9351b423ce2d889145c5d506280664eea2f58a74645c0ee29 SHA512 4206f6316d9b8cd34f2c790a94b2c2fc0210d9370f5145ff8a5f80b18209f1c393f6185cc5fa89877e9a51743d601db9d8d3a879d0b2f2ae74f168f3725dda30
+EBUILD intel-graphics-compiler-1.0.11485.ebuild 2636 BLAKE2B 46e80df315df3a06e54c9faa193418e3957f50fe2e5ad51e1bca714ec56a93d527eab9e02ac735515e4e7ee5f239a5b6018f56e2bffeb8ef838711607c6f2347 SHA512 9c9b88508d022ef7b9ba02081964fbededa9822d32f5a211c6fdfd70c064bce4233fd2d45ccaeb5c88e099f4877ac976ea355b7279034ad7dba538c1f55179f9
MISC metadata.xml 594 BLAKE2B de9f434fc853417b9d1c6199c7501c9fe702aa68b0eaa0f88d298563431de126fbdc259f0d541e85674b0205444f5d1febf0433b292a6ac40661d62af23457d8 SHA512 b939b315122a5fe3252242ccab8fbf049d9234ee67c6910969c178bcb56fc835bc954380f8c15bab23905ac852fa0fe0640f6ef2ee9d48502ae0e3379d7f7460
diff --git a/dev-util/intel-graphics-compiler/files/intel-graphics-compiler-1.0.11485-fix-BiF-caching.patch b/dev-util/intel-graphics-compiler/files/intel-graphics-compiler-1.0.11485-fix-BiF-caching.patch
new file mode 100644
index 000000000000..7ad261e0aa6c
--- /dev/null
+++ b/dev-util/intel-graphics-compiler/files/intel-graphics-compiler-1.0.11485-fix-BiF-caching.patch
@@ -0,0 +1,49 @@
+From 12c99343388eba6e6275856b25e0fa8978585dfb Mon Sep 17 00:00:00 2001
+From: Marcin Naczk <marcin.naczk@intel.com>
+Date: Mon, 13 Jun 2022 08:28:24 +0000
+Subject: [PATCH] Find OpenCl-c.h when clang is take from system.
+
+Find OpenCl-c.h when clang is take from system.
+---
+ IGC/cmake/igc_find_opencl_clang.cmake | 24 +++++++++++++++---------
+ 1 file changed, 15 insertions(+), 9 deletions(-)
+
+diff --git a/IGC/cmake/igc_find_opencl_clang.cmake b/IGC/cmake/igc_find_opencl_clang.cmake
+index dc8924fb7ee..0a54ac68249 100644
+--- a/IGC/cmake/igc_find_opencl_clang.cmake
++++ b/IGC/cmake/igc_find_opencl_clang.cmake
+@@ -94,19 +94,25 @@ if(CCLANG_FROM_SYSTEM)
+ else()
+ set_property(TARGET opencl-clang-lib PROPERTY "IMPORTED_LOCATION" "${SYSTEM_COMMON_CLANG}")
+ endif()
+- find_program(CLANG_GE7 clang-${LLVM_VERSION_MAJOR})
+- if(CLANG_GE7)
+- message(STATUS "[IGC] Found clang-${LLVM_VERSION_MAJOR} executable: ${CLANG_GE7}")
++ find_program(CLANG_EXE clang-${LLVM_VERSION_MAJOR})
++ if(CLANG_EXE)
++ message(STATUS "[IGC] Found clang-${LLVM_VERSION_MAJOR} executable: ${CLANG_EXE}")
+
+ add_executable(clang-tool IMPORTED GLOBAL)
+- set_property(TARGET clang-tool PROPERTY "IMPORTED_LOCATION" "${CLANG_GE7}")
++ set_property(TARGET clang-tool PROPERTY "IMPORTED_LOCATION" "${CLANG_EXE}")
+ set(CL_OPTIONS "-finclude-default-header")
+- if(LLVM_VERSION_MAJOR VERSION_EQUAL 7)
+- message(WARNING "[IGC] : clang-7 should be patched with VME patch (https://reviews.llvm.org/D51484). Assuming that it is. If not, please add -DVME_TYPES_DEFINED=FALSE.")
+- endif()
+- else(CLANG_GE7)
++
++ # Get parent dir of the location of CLANG_EXE
++ get_filename_component(CLANG_EXE_PARENT_DIR ${CLANG_EXE} DIRECTORY)
++ file(GLOB_RECURSE opencl-header ${CLANG_EXE_PARENT_DIR}/../*opencl-c.h)
++ if(opencl-header)
++ message(STATUS "[IGC] Found opencl-c.h: ${opencl-header}")
++ else(opencl-header)
++ message(FATAL_ERROR "[IGC] : Couldn't find opencl-c.h, please provide it.")
++ endif(opencl-header)
++ else(CLANG_EXE)
+ message(FATAL_ERROR "[IGC] : Couldn't find clang-${LLVM_VERSION_MAJOR} executable, please install it.")
+- endif(CLANG_GE7)
++ endif(CLANG_EXE)
+ ###
+ #2. CCLANG_BUILD_PREBUILDS - use prebuilt opencl-clang toolchain
+ elseif(${CCLANG_BUILD_PREBUILDS})
diff --git a/dev-util/intel-graphics-compiler/files/intel-graphics-compiler-1.0.11485-include-opencl-c.patch b/dev-util/intel-graphics-compiler/files/intel-graphics-compiler-1.0.11485-include-opencl-c.patch
new file mode 100644
index 000000000000..dbf4188ad0bc
--- /dev/null
+++ b/dev-util/intel-graphics-compiler/files/intel-graphics-compiler-1.0.11485-include-opencl-c.patch
@@ -0,0 +1,11 @@
+--- a/IGC/cmake/igc_find_opencl_clang.cmake
++++ b/IGC/cmake/igc_find_opencl_clang.cmake
+@@ -104,7 +104,7 @@
+
+ # Get parent dir of the location of CLANG_EXE
+ get_filename_component(CLANG_EXE_PARENT_DIR ${CLANG_EXE} DIRECTORY)
+- file(GLOB_RECURSE opencl-header ${CLANG_EXE_PARENT_DIR}/../*opencl-c.h)
++ file(GLOB_RECURSE opencl-header ${CCLANG_INCLUDE_PREBUILDS_DIR}/*opencl-c.h)
+ if(opencl-header)
+ message(STATUS "[IGC] Found opencl-c.h: ${opencl-header}")
+ else(opencl-header)
diff --git a/dev-util/intel-graphics-compiler/files/intel-graphics-compiler-1.0.11485-update-raytracing-llvm14.patch b/dev-util/intel-graphics-compiler/files/intel-graphics-compiler-1.0.11485-update-raytracing-llvm14.patch
new file mode 100644
index 000000000000..248f8244e32f
--- /dev/null
+++ b/dev-util/intel-graphics-compiler/files/intel-graphics-compiler-1.0.11485-update-raytracing-llvm14.patch
@@ -0,0 +1,186 @@
+From d9535cc5c3e54b21d56c492d4e21cb13c80b9b7a Mon Sep 17 00:00:00 2001
+From: Artem Gindinson <artem.gindinson@intel.com>
+Date: Wed, 22 Jun 2022 11:53:02 +0000
+Subject: [PATCH] Update RayTracing for full LLVM 14 buildability
+
+- Address further casting issues
+- Use pre-existing LLVM wrappers for function argument manipulations
+- Create & use LLVM wrappers for `AAQueryInfo` and
+ `CallBase::getRetDereferenceableBytes()`
+---
+ IGC/AdaptorCommon/RayTracing/AllocaTracking.cpp | 3 ++-
+ IGC/AdaptorCommon/RayTracing/InlineDataPass.cpp | 3 ++-
+ IGC/AdaptorCommon/RayTracing/LowerIntersectionAnyHit.cpp | 2 +-
+ IGC/AdaptorCommon/RayTracing/RTSpillShrinkPass.cpp | 4 ++--
+ IGC/AdaptorCommon/RayTracing/RayTracingFinalizePass.cpp | 4 ++--
+ IGC/AdaptorCommon/RayTracing/StackIDSchedulingPass.cpp | 3 ++-
+ IGC/AdaptorCommon/TypesLegalizationPass.cpp | 2 +-
+ .../include/llvmWrapper/Analysis/AliasAnalysis.h | 7 +++++++
+ IGC/WrapperLLVM/include/llvmWrapper/IR/InstrTypes.h | 9 +++++++++
+ 9 files changed, 28 insertions(+), 9 deletions(-)
+
+diff --git a/IGC/AdaptorCommon/RayTracing/AllocaTracking.cpp b/IGC/AdaptorCommon/RayTracing/AllocaTracking.cpp
+index b5ad27e32ca..67cf302495c 100644
+--- a/IGC/AdaptorCommon/RayTracing/AllocaTracking.cpp
++++ b/IGC/AdaptorCommon/RayTracing/AllocaTracking.cpp
+@@ -19,6 +19,7 @@ SPDX-License-Identifier: MIT
+ #include "common/LLVMWarningsPush.hpp"
+ #include <llvm/IR/Instruction.h>
+ #include <llvm/IR/IntrinsicInst.h>
++#include <llvmWrapper/IR/Instructions.h>
+ #include "common/LLVMWarningsPop.hpp"
+
+ using namespace llvm;
+@@ -129,7 +130,7 @@ void rewriteTypes(
+ "Only handles void right now!");
+
+ SmallVector<Type*, 4> Tys;
+- for (auto &Op : II->arg_operands())
++ for (auto &Op : IGCLLVM::args(II))
+ Tys.push_back(Op->getType());
+
+ auto* NewFTy = FunctionType::get(
+diff --git a/IGC/AdaptorCommon/RayTracing/InlineDataPass.cpp b/IGC/AdaptorCommon/RayTracing/InlineDataPass.cpp
+index 5e4df4e1a86..9433340d259 100644
+--- a/IGC/AdaptorCommon/RayTracing/InlineDataPass.cpp
++++ b/IGC/AdaptorCommon/RayTracing/InlineDataPass.cpp
+@@ -46,6 +46,7 @@ SPDX-License-Identifier: MIT
+ #include <vector>
+ #include "common/LLVMWarningsPush.hpp"
+ #include <llvm/IR/InstIterator.h>
++#include <llvmWrapper/IR/InstrTypes.h>
+ #include "common/LLVMWarningsPop.hpp"
+
+ using namespace llvm;
+@@ -155,7 +156,7 @@ bool BindlessInlineDataPass::runOnModule(Module &M)
+ // the size of the Shader Identifier + the size of the Local arguments
+ const uint64_t dereferenceable_size =
+ sizeof(ShaderIdentifier) +
+- local_buffer_ptr->getDereferenceableBytes(AttributeList::ReturnIndex);
++ IGCLLVM::getRetDereferenceableBytes(local_buffer_ptr);
+
+ // Return a CallInst* representing the InlinedData intrinsic call
+ // In the shader dumps,
+diff --git a/IGC/AdaptorCommon/RayTracing/LowerIntersectionAnyHit.cpp b/IGC/AdaptorCommon/RayTracing/LowerIntersectionAnyHit.cpp
+index 8b6bba69f23..2c3a98d04e3 100644
+--- a/IGC/AdaptorCommon/RayTracing/LowerIntersectionAnyHit.cpp
++++ b/IGC/AdaptorCommon/RayTracing/LowerIntersectionAnyHit.cpp
+@@ -449,7 +449,7 @@ CallInst* LowerIntersectionAnyHit::codeGenReportHit(
+ CustomHitAttrPtr,
+ 4,
+ Attrs,
+- std::min(4U, DL.getABITypeAlignment(AttrTy->getPointerElementType())),
++ std::min(4U, (unsigned)DL.getABITypeAlignment(AttrTy->getPointerElementType())),
+ IRB.getInt64(DL.getTypeAllocSize(AttrTy->getPointerElementType())));
+ }
+
+diff --git a/IGC/AdaptorCommon/RayTracing/RTSpillShrinkPass.cpp b/IGC/AdaptorCommon/RayTracing/RTSpillShrinkPass.cpp
+index 4d42b32af36..d8d7ac3c54f 100644
+--- a/IGC/AdaptorCommon/RayTracing/RTSpillShrinkPass.cpp
++++ b/IGC/AdaptorCommon/RayTracing/RTSpillShrinkPass.cpp
+@@ -61,9 +61,9 @@ class RTSpillShrinkPass : public FunctionPass
+
+ unsigned getAlignment(const DataLayout& DL, StoreInst* ST) const
+ {
+- unsigned Align = ST->getAlignment();
++ unsigned Align = (unsigned)ST->getAlignment();
+ if (Align == 0)
+- Align = DL.getABITypeAlignment(ST->getType());
++ Align = (unsigned)DL.getABITypeAlignment(ST->getType());
+ return Align;
+ }
+
+diff --git a/IGC/AdaptorCommon/RayTracing/RayTracingFinalizePass.cpp b/IGC/AdaptorCommon/RayTracing/RayTracingFinalizePass.cpp
+index 87549a6ce85..797e77a548d 100644
+--- a/IGC/AdaptorCommon/RayTracing/RayTracingFinalizePass.cpp
++++ b/IGC/AdaptorCommon/RayTracing/RayTracingFinalizePass.cpp
+@@ -114,7 +114,7 @@ bool RayTracingFinalizePass::runOnModule(Module &M)
+ {
+ // Temporary WA to ensure we don't page fault on unaligned
+ // acceses.
+- uint32_t Align = LI->getAlignment();
++ uint32_t Align = (uint32_t)LI->getAlignment();
+ if (Align == 0)
+ Align = (uint32_t)DL.getTypeAllocSize(LI->getType());
+
+@@ -125,7 +125,7 @@ bool RayTracingFinalizePass::runOnModule(Module &M)
+ {
+ // Temporary WA to ensure we don't page fault on unaligned
+ // acceses.
+- uint32_t Align = SI->getAlignment();
++ uint32_t Align = (uint32_t)SI->getAlignment();
+ if (Align == 0)
+ Align = (uint32_t)DL.getTypeAllocSize(
+ SI->getValueOperand()->getType());
+diff --git a/IGC/AdaptorCommon/RayTracing/StackIDSchedulingPass.cpp b/IGC/AdaptorCommon/RayTracing/StackIDSchedulingPass.cpp
+index db5490267fd..d352b67a50f 100644
+--- a/IGC/AdaptorCommon/RayTracing/StackIDSchedulingPass.cpp
++++ b/IGC/AdaptorCommon/RayTracing/StackIDSchedulingPass.cpp
+@@ -49,6 +49,7 @@ SPDX-License-Identifier: MIT
+ #include <llvm/IR/Dominators.h>
+ #include <llvm/Analysis/PostDominators.h>
+ #include <llvm/Analysis/LoopInfo.h>
++#include "llvmWrapper/Analysis/AliasAnalysis.h"
+ #include "llvmWrapper/Analysis/MemoryLocation.h"
+ #include "common/LLVMWarningsPop.hpp"
+
+@@ -175,7 +176,7 @@ BasicBlock* StackIDSchedulingPass::schedule(
+ ModRefInfo StackIDSchedulingPass::getModRefInfo(
+ const CallBase* Call, const MemoryLocation& Loc)
+ {
+- AAQueryInfo AAQIP;
++ AAQueryInfo AAQIP = IGCLLVM::makeAAQueryInfo();
+ return AA->getModRefInfo(Call, Loc, AAQIP);
+ }
+
+diff --git a/IGC/AdaptorCommon/TypesLegalizationPass.cpp b/IGC/AdaptorCommon/TypesLegalizationPass.cpp
+index c3570f39d31..10da29ee242 100644
+--- a/IGC/AdaptorCommon/TypesLegalizationPass.cpp
++++ b/IGC/AdaptorCommon/TypesLegalizationPass.cpp
+@@ -207,7 +207,7 @@ TypesLegalizationPass::ResolveValue( Instruction *ip,Value *val,SmallVector<unsi
+ {
+ IGCLLVM::IRBuilder<> builder( ld );
+ Value* gep = CreateGEP( builder,ld->getOperand( 0 ),indices );
+- unsigned alignment = ld->getAlignment();
++ unsigned alignment = (unsigned)ld->getAlignment();
+ unsigned pointerTypeSize = gep->getType()->getPointerElementType()->getScalarSizeInBits() / 8;
+ if ( alignment && pointerTypeSize == alignment )
+ return builder.CreateAlignedLoad( gep, IGCLLVM::getAlign(alignment) );
+diff --git a/IGC/WrapperLLVM/include/llvmWrapper/Analysis/AliasAnalysis.h b/IGC/WrapperLLVM/include/llvmWrapper/Analysis/AliasAnalysis.h
+index 873886cc860..385c04db970 100644
+--- a/IGC/WrapperLLVM/include/llvmWrapper/Analysis/AliasAnalysis.h
++++ b/IGC/WrapperLLVM/include/llvmWrapper/Analysis/AliasAnalysis.h
+@@ -19,6 +19,13 @@ namespace IGCLLVM
+ #else
+ using AliasResultEnum = llvm::AliasResult::Kind;
+ #endif
++inline llvm::AAQueryInfo makeAAQueryInfo() {
++#if LLVM_VERSION_MAJOR >= 14
++ return llvm::AAQueryInfo(new llvm::SimpleCaptureInfo());
++#else
++ return llvm::AAQueryInfo();
++#endif
++}
+ }
+
+ #endif
+diff --git a/IGC/WrapperLLVM/include/llvmWrapper/IR/InstrTypes.h b/IGC/WrapperLLVM/include/llvmWrapper/IR/InstrTypes.h
+index 569eece3fb5..1050c842271 100644
+--- a/IGC/WrapperLLVM/include/llvmWrapper/IR/InstrTypes.h
++++ b/IGC/WrapperLLVM/include/llvmWrapper/IR/InstrTypes.h
+@@ -50,6 +50,15 @@ namespace IGCLLVM
+ CI->addFnAttr(Kind);
+ #else
+ CI->addAttribute(llvm::AttributeList::FunctionIndex, Kind);
++#endif
++ }
++
++ inline uint64_t getRetDereferenceableBytes(llvm::CallBase* Call)
++ {
++#if LLVM_VERSION_MAJOR >= 14
++ return Call->getRetDereferenceableBytes();
++#else
++ return Call->getDereferenceableBytes(llvm::AttributeList::ReturnIndex);
+ #endif
+ }
+ }
diff --git a/dev-util/intel-graphics-compiler/files/intel-graphics-compiler-1.0.11485-wrap-getNumArgOperands.patch b/dev-util/intel-graphics-compiler/files/intel-graphics-compiler-1.0.11485-wrap-getNumArgOperands.patch
new file mode 100644
index 000000000000..23754ccb6b4b
--- /dev/null
+++ b/dev-util/intel-graphics-compiler/files/intel-graphics-compiler-1.0.11485-wrap-getNumArgOperands.patch
@@ -0,0 +1,24 @@
+From 1d5ceafdbc005f3adc58be5af1dc92f068908e16 Mon Sep 17 00:00:00 2001
+From: Artem Gindinson <artem.gindinson@intel.com>
+Date: Mon, 20 Jun 2022 12:38:04 +0000
+Subject: [PATCH] Wrap CallInst::getNumArgOperands calls for LLVM 14
+
+Rework all remaining call sites to rely on the already-existing wrapper
+function.
+---
+ IGC/Compiler/CISACodeGen/HFpackingOpt.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/IGC/Compiler/CISACodeGen/HFpackingOpt.cpp b/IGC/Compiler/CISACodeGen/HFpackingOpt.cpp
+index 69d6151f8bf..e24362d7791 100644
+--- a/IGC/Compiler/CISACodeGen/HFpackingOpt.cpp
++++ b/IGC/Compiler/CISACodeGen/HFpackingOpt.cpp
+@@ -825,7 +825,7 @@ bool HFpackingOpt::findStoreSequence(std::vector<Instruction*>& path, std::vecto
+ uint srciCount = inst->getNumOperands();
+ if (CallInst* cinst = dyn_cast<CallInst>(inst))
+ {
+- srciCount = cinst->getNumArgOperands();
++ srciCount = IGCLLVM::getNumArgOperands(cinst);
+ }
+
+ for (uint srci = 0; srci < srciCount; srci++)
diff --git a/dev-util/intel-graphics-compiler/intel-graphics-compiler-1.0.11485.ebuild b/dev-util/intel-graphics-compiler/intel-graphics-compiler-1.0.11485.ebuild
new file mode 100644
index 000000000000..74f02de2f3a1
--- /dev/null
+++ b/dev-util/intel-graphics-compiler/intel-graphics-compiler-1.0.11485.ebuild
@@ -0,0 +1,88 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+CMAKE_BUILD_TYPE="Release"
+LLVM_MAX_SLOT="13"
+MY_PN="igc"
+MY_P="${MY_PN}-${PV}"
+PYTHON_COMPAT=( python3_{8..11} )
+
+inherit cmake flag-o-matic llvm python-any-r1
+
+DESCRIPTION="LLVM-based OpenCL compiler for OpenCL targetting Intel Gen graphics hardware"
+HOMEPAGE="https://github.com/intel/intel-graphics-compiler"
+SRC_URI="https://github.com/intel/${PN}/archive/${MY_P}.tar.gz -> ${P}.tar.gz"
+S="${WORKDIR}/${PN}-${MY_P}"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE="debug"
+
+DEPEND="
+ dev-libs/opencl-clang:${LLVM_MAX_SLOT}=
+ dev-util/spirv-tools
+ =sys-devel/lld-${LLVM_MAX_SLOT}*
+ sys-devel/llvm:${LLVM_MAX_SLOT}=
+"
+
+RDEPEND="${DEPEND}"
+
+BDEPEND="
+ =sys-devel/lld-${LLVM_MAX_SLOT}*
+ ${PYTHON_DEPS}
+"
+
+PATCHES=(
+ "${FILESDIR}/${PN}-1.0.9-no_Werror.patch"
+ "${FILESDIR}/${PN}-1.0.8173-opencl-clang_version.patch"
+ "${FILESDIR}/${PN}-1.0.8365-disable-git.patch"
+ "${FILESDIR}/${PN}-1.0.11485-fix-BiF-caching.patch"
+ "${FILESDIR}/${PN}-1.0.11485-update-raytracing-llvm14.patch"
+ "${FILESDIR}/${PN}-1.0.11485-wrap-getNumArgOperands.patch"
+ "${FILESDIR}/${PN}-1.0.11485-include-opencl-c.patch"
+)
+
+pkg_setup() {
+ llvm_pkg_setup
+ python-any-r1_pkg_setup
+}
+
+src_configure() {
+ # Get LLVM version
+ local llvm_version="$(best_version -d sys-devel/llvm:${LLVM_MAX_SLOT})"
+
+ # See https://github.com/intel/intel-graphics-compiler/issues/212
+ append-ldflags -Wl,-z,undefs
+
+ # See https://bugs.gentoo.org/718824
+ ! use debug && append-cppflags -DNDEBUG
+
+ local mycmakeargs=(
+ -DCCLANG_INCLUDE_PREBUILDS_DIR="/usr/lib/clang/${llvm_version##*-}/include"
+ -DCCLANG_SONAME_VERSION="${LLVM_MAX_SLOT}"
+ -DCMAKE_LIBRARY_PATH="$(get_llvm_prefix ${LLVM_MAX_SLOT})/$(get_libdir)"
+ -DIGC_OPTION__ARCHITECTURE_TARGET="Linux64"
+ -DIGC_OPTION__CLANG_MODE="Prebuilds"
+ -DIGC_OPTION__LINK_KHRONOS_SPIRV_TRANSLATOR="ON"
+ -DIGC_OPTION__LLD_MODE="Prebuilds"
+ -DIGC_OPTION__LLDELF_H_DIR="${EPREFIX}/usr/include/lld/Common"
+ -DIGC_OPTION__LLVM_MODE="Prebuilds"
+ -DIGC_OPTION__LLVM_PREFERRED_VERSION="${llvm_version##*-}"
+ -DIGC_OPTION__SPIRV_TOOLS_MODE="Prebuilds"
+ -DIGC_OPTION__SPIRV_TRANSLATOR_MODE="Prebuilds"
+ -DIGC_OPTION__USE_PREINSTALLED_SPRIV_HEADERS="ON"
+ -DINSTALL_GENX_IR="ON"
+ -DSPIRVLLVMTranslator_INCLUDE_DIR="${EPREFIX}/usr/lib/llvm/${LLVM_MAX_SLOT}/include/LLVMSPIRVLib"
+ -Wno-dev
+
+ # Compilation with VectorCompiler causes currently a segfault.
+ # See https://github.com/intel/intel-graphics-compiler/issues/236
+ -DIGC_BUILD__VC_ENABLED="OFF"
+ # -DIGC_OPTION__VC_INTRINSICS_MODE="Prebuilds"
+ )
+
+ cmake_src_configure
+}