Index: head/devel/intel-graphics-compiler/Makefile =================================================================== --- head/devel/intel-graphics-compiler/Makefile (revision 556178) +++ head/devel/intel-graphics-compiler/Makefile (revision 556179) @@ -1,59 +1,59 @@ # $FreeBSD$ PORTNAME= intel-graphics-compiler DISTVERSIONPREFIX= igc- -DISTVERSION= 1.0.5435 +DISTVERSION= 1.0.5585 CATEGORIES= devel PATCH_SITES= https://github.com/${GH_ACCOUNT}/${GH_PROJECT}/commit/ PATCHFILES+= d878880cbb3b.patch:-p1 # https://github.com/intel/intel-graphics-compiler/pull/129 MAINTAINER= jbeich@FreeBSD.org COMMENT= Intel Graphics Compiler for OpenCL LICENSE= MIT LICENSE_FILE= ${WRKSRC}/LICENSE.md ONLY_FOR_ARCHS= amd64 i386 ONLY_FOR_ARCHS_REASON= Only Intel GPUs on x86 are supported LIB_DEPENDS= libopencl-clang.so:devel/opencl-clang USES= bison cmake compiler:c++17-lang python:build USE_GITHUB= yes USE_LDCONFIG= yes GH_ACCOUNT= intel -GH_TUPLE= intel:vc-intrinsics:d2a2184:vcintrin/../vc-intrinsics +GH_TUPLE= intel:vc-intrinsics:a08fe5b:vcintrin/../vc-intrinsics CMAKE_OFF= INSTALL_SPIRVDLL CFLAGS+= -Wno-macro-redefined # __fastcall PLIST_SUB= ARCH_SUFX=${ARCH:S/i386/32/:S/amd//:S/x86_//} .if (exists(/usr/lib/clang/10.0.0) || exists(/usr/lib/clang/10.0.1) || exists(/usr/lib/clang/11.0.0)) && ${CXX} == c++ # https://github.com/intel/intel-graphics-compiler/issues/126 BUILD_DEPENDS+= clang++90:devel/llvm90 USES:= ${USES:Ncompiler*} CXX= clang++90 .endif post-patch: # lang/python* don't install unsuffixed symlinks @${REINPLACE_CMD} -i .python \ -e '/EXECUTABLE/s/"python"/"${PYTHON_CMD:T}"/' \ -e '/IGC_PYTHON/s/"python"/"${PYTHON_CMD:T}"/' \ ${WRKSRC}/IGC/CMakeLists.txt \ ${WRKSRC}/IGC/BiFModule/CMakeLists.txt # devel/llvm* have different naming from upstream under PATH @${REINPLACE_CMD} -e '/clang-\$$/s//clang$$/' \ ${WRKSRC}/IGC/BiFModule/CMakeLists.txt # No need to abort on every benign warning enabled by default @${REINPLACE_CMD} -e 's/"-Werror"//; /-Werror/d' \ ${WRKSRC}/IGC/CMakeLists.txt pre-configure: # Only one libLLVM can be loaded, so use the same version as devel/opencl-clang @for f in ${LOCALBASE}/lib/libopencl-clang.so.*; do \ ${REINPLACE_CMD} "/set.*LLVM_VERSION/s/\".*\"/\"$${f##*so.}\"/" \ ${WRKSRC}/IGC/CMakeLists.txt; \ done .include Index: head/devel/intel-graphics-compiler/distinfo =================================================================== --- head/devel/intel-graphics-compiler/distinfo (revision 556178) +++ head/devel/intel-graphics-compiler/distinfo (revision 556179) @@ -1,7 +1,7 @@ -TIMESTAMP = 1604048906 -SHA256 (intel-intel-graphics-compiler-igc-1.0.5435_GH0.tar.gz) = 9dec70f57a7a65e8f8e041f72d4c50fe3f4bb3bef205e5173a3e1d8031176d55 -SIZE (intel-intel-graphics-compiler-igc-1.0.5435_GH0.tar.gz) = 6642724 -SHA256 (intel-vc-intrinsics-d2a2184_GH0.tar.gz) = ac7830e1aca51c17a88a3be06cf6f1cfe3e9126a233c5494a157466694f3b1d1 -SIZE (intel-vc-intrinsics-d2a2184_GH0.tar.gz) = 119029 +TIMESTAMP = 1605259891 +SHA256 (intel-intel-graphics-compiler-igc-1.0.5585_GH0.tar.gz) = c01535b502a35817886424d6918eec20352ab32fdaa4afa7ff0d7622ecc23c04 +SIZE (intel-intel-graphics-compiler-igc-1.0.5585_GH0.tar.gz) = 7234175 +SHA256 (intel-vc-intrinsics-a08fe5b_GH0.tar.gz) = e57f05d56e385449ed86fdbbb3b5f75ba67537dce137176e371c30081c4fea2f +SIZE (intel-vc-intrinsics-a08fe5b_GH0.tar.gz) = 119121 SHA256 (d878880cbb3b.patch) = f430b2da0d212594ce73f23b279a1435f08dea60f30ec35494411ab0dc0fcf70 SIZE (d878880cbb3b.patch) = 9088 Index: head/devel/intel-graphics-compiler/files/patch-revert =================================================================== --- head/devel/intel-graphics-compiler/files/patch-revert (nonexistent) +++ head/devel/intel-graphics-compiler/files/patch-revert (revision 556179) @@ -0,0 +1,353 @@ +https://github.com/intel/intel-graphics-compiler/issues/155 + +--- IGC/Compiler/CISACodeGen/ResolveGAS.cpp.orig 2020-11-13 09:31:31 UTC ++++ IGC/Compiler/CISACodeGen/ResolveGAS.cpp +@@ -35,7 +35,6 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + #include "llvm/Support/Debug.h" + #include "llvmWrapper/IR/Constant.h" + #include +-#include + #include + #include + #include +@@ -80,8 +79,6 @@ namespace { + void getAnalysisUsage(AnalysisUsage& AU) const override { + AU.setPreservesCFG(); + AU.addRequired(); +- AU.addRequired(); +- AU.addRequired(); + } + + bool isResolvableLoopPHI(PHINode* PN) const { +@@ -92,17 +89,11 @@ namespace { + bool resolveOnFunction(Function*) const; + bool resolveOnBasicBlock(BasicBlock*) const; + +- bool resolveMemoryFromHost(Function&) const; +- + void populateResolvableLoopPHIs(); + void populateResolvableLoopPHIsForLoop(const Loop*); + + bool isAddrSpaceResolvable(PHINode* PN, const Loop* L, + BasicBlock* BackEdge) const; +- +- bool checkGenericArguments(Function& F) const; +- void convertLoadToGlobal(LoadInst* LI) const; +- bool isLoadGlobalCandidate(LoadInst* LI) const; + }; + + class GASPropagator : public InstVisitor { +@@ -157,8 +148,6 @@ namespace IGC { + IGC_INITIALIZE_PASS_BEGIN(GASResolving, PASS_FLAG, PASS_DESC, PASS_CFG_ONLY, + PASS_ANALYSIS) + IGC_INITIALIZE_PASS_DEPENDENCY(LoopInfoWrapperPass) +- IGC_INITIALIZE_PASS_DEPENDENCY(AAResultsWrapperPass) +- IGC_INITIALIZE_PASS_DEPENDENCY(MetaDataUtilsWrapper) + IGC_INITIALIZE_PASS_END(GASResolving, PASS_FLAG, PASS_DESC, PASS_CFG_ONLY, + PASS_ANALYSIS) + } +@@ -169,8 +158,6 @@ bool GASResolving::runOnFunction(Function& F) { + IRB = &TheBuilder; + Propagator = &ThePropagator; + +- resolveMemoryFromHost(F); +- + populateResolvableLoopPHIs(); + + bool Changed = false; +@@ -687,175 +674,5 @@ bool GASPropagator::visitCallInst(CallInst& I) { + return true; + } + +- return false; +-} +- +-bool GASResolving::resolveMemoryFromHost(Function& F) const { +- MetaDataUtils* pMdUtils = getAnalysis().getMetaDataUtils(); +- +- // skip all non-entry functions +- if (!isEntryFunc(pMdUtils, &F)) +- return false; +- +- // early check in order not to iterate whole function +- if (!checkGenericArguments(F)) +- return false; +- +- SmallVector Stores; +- SmallVector Loads; +- AliasAnalysis* AA = &getAnalysis().getAAResults(); +- +- // collect load candidates and in parallel check for unsafe instructions +- // visitor may be a more beautiful way to do this +- bool HasASCast = false; // if there exists addrspace cast from non global/generic space +- bool HasPtoi = false; // if there exists ptrtoint with global/generic space +- for (BasicBlock& B : F) { +- for (Instruction& I : B) { +- if (auto LI = dyn_cast(&I)) { +- if (isLoadGlobalCandidate(LI)) { +- Loads.push_back(LI); +- } +- } +- else if (auto CI = dyn_cast(&I)) { +- if (CI->onlyReadsMemory()) +- continue; +- +- // currently recognize only these ones +- // in fact intrinsics should be marked as read-only +- if (auto II = dyn_cast(CI)) { +- if (II->getIntrinsicID() == Intrinsic::lifetime_start || +- II->getIntrinsicID() == Intrinsic::lifetime_end) +- continue; +- } +- +- // if we have an unsafe call in the kernel, abort +- // to improve we can collect arguments of writing calls as memlocations for alias analysis +- return false; +- } +- else if (auto PI = dyn_cast(&I)) { +- // if we have a ptrtoint we need to check data flow which we don't want to +- if (PI->getPointerAddressSpace() != ADDRESS_SPACE_GLOBAL && +- PI->getPointerAddressSpace() != ADDRESS_SPACE_GENERIC) +- return false; +- else { +- HasPtoi = true; +- } +- +- return false; +- } +- else if (auto AI = dyn_cast(&I)) { +- if (AI->getSrcAddressSpace() != ADDRESS_SPACE_GLOBAL && +- AI->getSrcAddressSpace() != ADDRESS_SPACE_GENERIC) { +- HasASCast = true; +- } +- } +- else if (auto SI = dyn_cast(&I)) { +- Value* V = SI->getValueOperand(); +- if (isa(V->getType())) { +- // this store can potentially write non-global pointer to memory +- Stores.push_back(SI); +- } +- } +- else if (I.mayWriteToMemory()) { +- // unsupported instruction poisoning memory +- return false; +- } +- } +- } +- if (HasASCast && HasPtoi) +- return false; +- +- if (Loads.empty()) +- return false; +- +- bool Changed = false; +- while (!Loads.empty()) +- { +- LoadInst* LI = Loads.pop_back_val(); +- +- // check that we don't have aliasing stores for this load +- // we expect to have basic and addrspace AA available at the moment +- // on optimization phase +- bool aliases = false; +- for (auto SI : Stores) { +- if (AA->alias(MemoryLocation::get(SI), MemoryLocation::get(LI))) { +- aliases = true; +- break; +- } +- } +- if (aliases) +- continue; +- +- convertLoadToGlobal(LI); +- Changed = true; +- } +- return Changed; +-} +- +-bool GASResolving::isLoadGlobalCandidate(LoadInst* LI) const { +- // first check that loaded address has generic address space +- // otherwise it is not our candidate +- PointerType* PtrTy = dyn_cast(LI->getType()); +- if (!PtrTy || PtrTy->getAddressSpace() != ADDRESS_SPACE_GENERIC) +- return false; +- +- // next check that it is a load from function argument + offset +- // which is necessary to prove that this address has global addrspace +- Value* LoadBase = LI->getPointerOperand()->stripInBoundsOffsets(); +- if (!isa(LoadBase)) +- return false; +- +- // don't want to process cases when argument is from local address space +- auto LoadTy = cast(LoadBase->getType()); +- if (LoadTy->getAddressSpace() != ADDRESS_SPACE_GLOBAL) +- return false; +- +- // TODO: skip cases that have been fixed on previous traversals +- +- return true; +-} +- +-void GASResolving::convertLoadToGlobal(LoadInst* LI) const { +- // create two addressspace casts: generic -> global -> generic +- // the next scalar phase of this pass will propagate global to all uses of the load +- +- PointerType* PtrTy = cast(LI->getType()); +- IRB->SetInsertPoint(LI->getNextNode()); +- PointerType* GlobalPtrTy = PointerType::get(PtrTy->getElementType(), ADDRESS_SPACE_GLOBAL); +- Value* GlobalAddr = IRB->CreateAddrSpaceCast(LI, GlobalPtrTy); +- Value* GenericCopyAddr = IRB->CreateAddrSpaceCast(GlobalAddr, PtrTy); +- +- for (auto UI = LI->use_begin(), UE = LI->use_end(); UI != UE; /*EMPTY*/) { +- Use& U = *UI++; +- if (U.getUser() == GlobalAddr) +- continue; +- U.set(GenericCopyAddr); +- } +-} +- +-bool GASResolving::checkGenericArguments(Function& F) const { +- // check that we have a pointer to pointer or pointer to struct that has pointer elements +- // and main pointer type is global while underlying pointer type is generic +- +- auto* FT = F.getFunctionType(); +- for (unsigned p = 0; p < FT->getNumParams(); ++p) { +- if (auto Ty = dyn_cast(FT->getParamType(p))) { +- if (Ty->getAddressSpace() != ADDRESS_SPACE_GLOBAL) +- continue; +- auto PteeTy = Ty->getElementType(); +- if (auto PTy = dyn_cast(PteeTy)) { +- if (PTy->getAddressSpace() == ADDRESS_SPACE_GENERIC) +- return true; +- } +- if (auto STy = dyn_cast(PteeTy)) { +- for (unsigned e = 0; e < STy->getNumElements(); ++e) { +- if (auto ETy = dyn_cast(STy->getElementType(e))) { +- if (ETy->getAddressSpace() == ADDRESS_SPACE_GENERIC) +- return true; +- } +- } +- } +- } +- } + return false; + } +--- IGC/VectorCompiler/lib/GenXOpts/CMPacketize/GenXPacketize.cpp.orig 2020-11-13 09:31:31 UTC ++++ IGC/VectorCompiler/lib/GenXOpts/CMPacketize/GenXPacketize.cpp +@@ -276,7 +276,7 @@ Function *GenXPacketize::vectorizeSIMTFunction(Functio + VecFName + Suffix[Width / 8], F->getParent()); + ClonedFunc->setCallingConv(F->getCallingConv()); + ClonedFunc->setAttributes(F->getAttributes()); +- ClonedFunc->setAlignment(IGCLLVM::getAlign(*F)); ++ ClonedFunc->setAlignment(IGCLLVM::getAlign(F->getAlignment())); + + // then use CloneFunctionInto + ValueToValueMapTy ArgMap; +@@ -888,8 +888,10 @@ Value *GenXPacketize::packetizeLLVMInstruction(Instruc + ->isPointerTy()); + auto Align = LI->getAlignment(); + pReplacedInst = B->MASKED_GATHER(pVecSrc, Align); +- } else +- pReplacedInst = B->ALIGNED_LOAD(pVecSrc, IGCLLVM::getAlign(*LI)); ++ } else { ++ auto Align = LI->getAlignment(); ++ pReplacedInst = B->ALIGNED_LOAD(pVecSrc, Align); ++ } + break; + } + +--- IGC/VectorCompiler/lib/GenXOpts/CMPacketize/gen_builder.hpp.orig 2020-11-13 09:31:31 UTC ++++ IGC/VectorCompiler/lib/GenXOpts/CMPacketize/gen_builder.hpp +@@ -573,24 +573,24 @@ StoreInst* STORE(Value *Val, Value *Ptr, bool isVolati + return IRB()->CreateStore(Val, Ptr, isVolatile); + } + +-inline LoadInst* ALIGNED_LOAD(Value *Ptr, IGCLLVM::Align Align, const char *Name) ++LoadInst* ALIGNED_LOAD(Value *Ptr, unsigned Align, const char *Name) + { +- return IRB()->CreateAlignedLoad(Ptr, Align, Name); ++ return IRB()->CreateAlignedLoad(Ptr, IGCLLVM::getAlign(Align), Name); + } + +-inline LoadInst* ALIGNED_LOAD(Value *Ptr, IGCLLVM::Align Align, const Twine &Name = "") ++LoadInst* ALIGNED_LOAD(Value *Ptr, unsigned Align, const Twine &Name = "") + { +- return IRB()->CreateAlignedLoad(Ptr, Align, Name); ++ return IRB()->CreateAlignedLoad(Ptr, IGCLLVM::getAlign(Align), Name); + } + +-inline LoadInst* ALIGNED_LOAD(Value *Ptr, IGCLLVM::Align Align, bool isVolatile, const Twine &Name = "") ++LoadInst* ALIGNED_LOAD(Value *Ptr, unsigned Align, bool isVolatile, const Twine &Name = "") + { +- return IRB()->CreateAlignedLoad(Ptr, Align, isVolatile, Name); ++ return IRB()->CreateAlignedLoad(Ptr, IGCLLVM::getAlign(Align), isVolatile, Name); + } + +-inline StoreInst* ALIGNED_STORE(Value *Val, Value *Ptr, IGCLLVM::Align Align, bool isVolatile = false) ++StoreInst* ALIGNED_STORE(Value *Val, Value *Ptr, unsigned Align, bool isVolatile = false) + { +- return IRB()->CreateAlignedStore(Val, Ptr, Align, isVolatile); ++ return IRB()->CreateAlignedStore(Val, Ptr, IGCLLVM::getAlign(Align), isVolatile); + } + + FenceInst* FENCE(AtomicOrdering Ordering, SyncScope::ID SSID = SyncScope::System, const Twine &Name = "") +--- IGC/WrapperLLVM/include/llvmWrapper/Support/Alignment.h.orig 2020-11-13 09:31:31 UTC ++++ IGC/WrapperLLVM/include/llvmWrapper/Support/Alignment.h +@@ -63,36 +63,48 @@ namespace IGCLLVM { + inline llvm::Align getAlignmentValueIfNeeded(llvm::Align A) { return A; } + #endif + +- using Align = ++ template= 11 +- llvm::Align; ++ llvm::Align + #endif +- +- inline Align getCorrectAlign(uint32_t Val) ++ > ++ inline T getCorrectAlign(uint32_t Val) + { +- return Align{ Val }; ++ return T{ Val }; + } + + // It is meant for copying alignement. + // getAlign returns different type for different LLVM versions but + // it can be overcome by using auto or direct usage in another LLVM + // interface. ++#if LLVM_VERSION_MAJOR <= 9 + template ::value, int> = 0> +- Align getAlign(const TValue &Val) ++ unsigned getAlign(const TValue &Val) + { +-#if LLVM_VERSION_MAJOR <= 9 + return Val.getAlignment(); ++ } + #elif LLVM_VERSION_MAJOR <= 10 ++ template ::value, int> = 0> ++ llvm::MaybeAlign getAlign(const TValue &Val) ++ { ++ // LLVM 10 instructions accept MaybeAlign but do not provide ++ // getMaybeAlignMethod + return llvm::MaybeAlign(Val.getAlignment()); ++ } + #else ++ template ::value, int> = 0> ++ llvm::Align getAlign(const TValue &Val) ++ { + return Val.getAlign(); +-#endif + } ++#endif + + } // namespace IGCLLVM + Property changes on: head/devel/intel-graphics-compiler/files/patch-revert ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property