Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prebuilt VC Intrinsics #142

Closed
Bidski opened this issue Aug 3, 2020 · 13 comments
Closed

Prebuilt VC Intrinsics #142

Bidski opened this issue Aug 3, 2020 · 13 comments
Assignees

Comments

@Bidski
Copy link

Bidski commented Aug 3, 2020

Is it possible prebuild VC Intrinsics for the VectorCompiler module rather than needing to have the vc-intrisincs sources available?

@ArchangeGabriel
Copy link
Contributor

That would indeed be better for distro packaging.

@kv-sc kv-sc self-assigned this Aug 10, 2020
@ArchangeGabriel
Copy link
Contributor

I’d like to refresh this question since we are going to upgrade our stack to LLVM 11 soon and resume IGC upgrade on Arch Linux. ;)

@eero-t
Copy link

eero-t commented Nov 16, 2020

See also: intel/vc-intrinsics#36

@tjaalton
Copy link

I finally got intel-vc-intrinsics package accepted in Debian, and then I see this..

@eero-t
Copy link

eero-t commented Feb 17, 2022

I finally got intel-vc-intrinsics package accepted in Debian, and then I see this..

Based on there being no responses to this from IGC developers since it was opened 1.5 years ago, it does not seem like bundling is going to happen...

@eero-t
Copy link

eero-t commented Feb 23, 2022

FYI: vc-intrinsics project has now its first tag (v0.1.0).

@pszymich
Copy link
Contributor

A commit adding support for prebuilt/preinstalled VC intrinsics package has been merged recently: 35c947c
Thank you @StepanMishura!

Please verify if that solves the problem. Thanks!

@pszymich pszymich assigned kv-sc and unassigned kv-sc Feb 23, 2022
@ArchangeGabriel
Copy link
Contributor

Works fine, thanks!

@ArchangeGabriel
Copy link
Contributor

Actually spoken too fast. While the prebuilt intrinsics gets properly detected, compilation fails with:

../../../../Release/libCMCLSupport.a(BuiltinTranslator.cpp.o): in function `llvm::Function* getGenXDeclarationForIdFromArgs<std::vector<llvm::Value*, std::allocator<llvm::Value*> > const&>(llvm::Type&, std::vector<llvm::Value*, std::allocator<llvm::Value*> > const&, llvm::GenXIntrinsic::ID, llvm::Module&)':
/build/intel-graphics-compiler/src/intel-graphics-compiler-igc-1.0.10409/IGC/VectorCompiler/CMCL/lib/Support/BuiltinTranslator.cpp:110: undefined reference to `llvm::GenXIntrinsic::isOverloadedRet(unsigned int)'
/usr/bin/ld: /build/intel-graphics-compiler/src/intel-graphics-compiler-igc-1.0.10409/IGC/VectorCompiler/CMCL/lib/Support/BuiltinTranslator.cpp:117: undefined reference to `llvm::GenXIntrinsic::isOverloadedArg(unsigned int, unsigned int)'
/usr/bin/ld: /build/intel-graphics-compiler/src/intel-graphics-compiler-igc-1.0.10409/IGC/VectorCompiler/CMCL/lib/Support/BuiltinTranslator.cpp:121: undefined reference to `llvm::GenXIntrinsic::getGenXDeclaration(llvm::Module*, llvm::GenXIntrinsic::ID, llvm::ArrayRef<llvm::Type*>)'

Switching back to sources works.

@ArchangeGabriel
Copy link
Contributor

Actually I’m facing similar errors with ispc, also building with those prebuilt vc-intrinsics:

/usr/bin/ld: /tmp/lto-llvm-d034b8.o: in function `ispc::AddBitcodeToModule(ispc::BitcodeLib const*, llvm::Module*, ispc::SymbolTable*)':
ld-temp.o:(.text._ZN4ispc18AddBitcodeToModuleEPKNS_10BitcodeLibEPN4llvm6ModuleEPNS_11SymbolTableE+0x20e): undefined reference to `llvm::GenXIntrinsic::getGenXIntrinsicID(llvm::Function const*)'
/usr/bin/ld: ld-temp.o:(.text._ZN4ispc18AddBitcodeToModuleEPKNS_10BitcodeLibEPN4llvm6ModuleEPNS_11SymbolTableE+0x219): undefined reference to `llvm::GenXIntrinsic::getAttributes(llvm::LLVMContext&, llvm::GenXIntrinsic::ID)'
/usr/bin/ld: /tmp/lto-llvm-d034b8.o: in function `ispc::FunctionEmitContext::BranchInst(llvm::BasicBlock*, llvm::BasicBlock*, llvm::Value*)':
ld-temp.o:(.text._ZN4ispc19FunctionEmitContext10BranchInstEPN4llvm10BasicBlockES3_PNS1_5ValueE+0x175): undefined reference to `llvm::GenXIntrinsic::getGenXDeclaration(llvm::Module*, llvm::GenXIntrinsic::ID, llvm::ArrayRef<llvm::Type*>)'
/usr/bin/ld: /tmp/lto-llvm-d034b8.o: in function `ispc::FunctionEmitContext::XeSimdCFPredicate(llvm::Value*, llvm::Value*)':
ld-temp.o:(.text._ZN4ispc19FunctionEmitContext17XeSimdCFPredicateEPN4llvm5ValueES3_+0x92): undefined reference to `llvm::GenXIntrinsic::getGenXDeclaration(llvm::Module*, llvm::GenXIntrinsic::ID, llvm::ArrayRef<llvm::Type*>)'
/usr/bin/ld: /tmp/lto-llvm-d034b8.o: in function `ispc::FunctionEmitContext::XeStartUnmaskedRegion()':
ld-temp.o:(.text._ZN4ispc19FunctionEmitContext21XeStartUnmaskedRegionEv+0x35): undefined reference to `llvm::GenXIntrinsic::getGenXDeclaration(llvm::Module*, llvm::GenXIntrinsic::ID, llvm::ArrayRef<llvm::Type*>)'
/usr/bin/ld: /tmp/lto-llvm-d034b8.o: in function `ispc::FunctionEmitContext::XeEndUnmaskedRegion(llvm::Value*)':
ld-temp.o:(.text._ZN4ispc19FunctionEmitContext19XeEndUnmaskedRegionEPN4llvm5ValueE+0x47): undefined reference to `llvm::GenXIntrinsic::getGenXDeclaration(llvm::Module*, llvm::GenXIntrinsic::ID, llvm::ArrayRef<llvm::Type*>)'
/usr/bin/ld: /tmp/lto-llvm-d034b8.o: in function `ispc::lIsSVMLoad(llvm::Instruction*)':
ld-temp.o:(.text._ZN4ispc10lIsSVMLoadEPN4llvm11InstructionE+0x20): undefined reference to `llvm::GenXIntrinsic::getGenXIntrinsicID(llvm::Function const*)'
/usr/bin/ld: /tmp/lto-llvm-d034b8.o: in function `ispc::Module::AddLLVMIntrinsicDecl(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, ispc::ExprList*, ispc::SourcePos)':
ld-temp.o:(.text._ZN4ispc6Module20AddLLVMIntrinsicDeclERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPNS_8ExprListENS_9SourcePosE+0x66): undefined reference to `llvm::GenXIntrinsic::lookupGenXIntrinsicID(llvm::StringRef)'
/usr/bin/ld: ld-temp.o:(.text._ZN4ispc6Module20AddLLVMIntrinsicDeclERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPNS_8ExprListENS_9SourcePosE+0x91): undefined reference to `llvm::GenXIntrinsic::isOverloadedRet(unsigned int)'
/usr/bin/ld: ld-temp.o:(.text._ZN4ispc6Module20AddLLVMIntrinsicDeclERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPNS_8ExprListENS_9SourcePosE+0x10f): undefined reference to `llvm::GenXIntrinsic::isOverloadedArg(unsigned int, unsigned int)'
/usr/bin/ld: ld-temp.o:(.text._ZN4ispc6Module20AddLLVMIntrinsicDeclERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPNS_8ExprListENS_9SourcePosE+0x2b6): undefined reference to `llvm::GenXIntrinsic::getGenXDeclaration(llvm::Module*, llvm::GenXIntrinsic::ID, llvm::ArrayRef<llvm::Type*>)'
/usr/bin/ld: /tmp/lto-llvm-d034b8.o: in function `ispc::Optimize(llvm::Module*, int)':
ld-temp.o:(.text._ZN4ispc8OptimizeEPN4llvm6ModuleEi+0x51f): undefined reference to `llvm::createISPCSimdCFLoweringPass()'
/usr/bin/ld: ld-temp.o:(.text._ZN4ispc8OptimizeEPN4llvm6ModuleEi+0x4796): undefined reference to `llvm::createGenXSPIRVWriterAdaptorPass(bool, bool)'
/usr/bin/ld: ld-temp.o:(.text._ZN4ispc8OptimizeEPN4llvm6ModuleEi+0x49cf): undefined reference to `llvm::createISPCSimdCFLoweringPass()'
/usr/bin/ld: ld-temp.o:(.text._ZN4ispc8OptimizeEPN4llvm6ModuleEi+0x53b6): undefined reference to `llvm::createGenXSPIRVWriterAdaptorPass(bool, bool)'
/usr/bin/ld: /tmp/lto-llvm-d034b8.o: in function `lRunXeCoalescing(std::map<llvm::Value*, std::map<llvm::Type*, std::vector<PtrUse, std::allocator<PtrUse> >, std::less<llvm::Type*>, std::allocator<std::pair<llvm::Type* const, std::vector<PtrUse, std::allocator<PtrUse> > > > >, std::less<llvm::Value*>, std::allocator<std::pair<llvm::Value* const, std::map<llvm::Type*, std::vector<PtrUse, std::allocator<PtrUse> >, std::less<llvm::Type*>, std::allocator<std::pair<llvm::Type* const, std::vector<PtrUse, std::allocator<PtrUse> > > > > > > >&, std::vector<llvm::Instruction*, std::allocator<llvm::Instruction*> >&)':
ld-temp.o:(.text._ZL16lRunXeCoalescingRSt3mapIPN4llvm5ValueES_IPNS0_4TypeESt6vectorI6PtrUseSaIS6_EESt4lessIS4_ESaISt4pairIKS4_S8_EEES9_IS2_ESaISB_IKS2_SF_EEERS5_IPNS0_11InstructionESaISN_EE+0x794): undefined reference to `llvm::GenXIntrinsic::getGenXDeclaration(llvm::Module*, llvm::GenXIntrinsic::ID, llvm::ArrayRef<llvm::Type*>)'
/usr/bin/ld: /tmp/lto-llvm-d034b8.o: in function `ReplaceLLVMIntrinsics::runOnFunction(llvm::Function&)':
ld-temp.o:(.text._ZN21ReplaceLLVMIntrinsics13runOnFunctionERN4llvm8FunctionE+0x252): undefined reference to `llvm::GenXIntrinsic::getGenXDeclaration(llvm::Module*, llvm::GenXIntrinsic::ID, llvm::ArrayRef<llvm::Type*>)'
/usr/bin/ld: ld-temp.o:(.text._ZN21ReplaceLLVMIntrinsics13runOnFunctionERN4llvm8FunctionE+0x327): undefined reference to `llvm::GenXIntrinsic::getGenXDeclaration(llvm::Module*, llvm::GenXIntrinsic::ID, llvm::ArrayRef<llvm::Type*>)'
/usr/bin/ld: /tmp/lto-llvm-d034b8.o: in function `ImproveMemoryOpsPass::runOnBasicBlock(llvm::BasicBlock&)':
ld-temp.o:(.text._ZN20ImproveMemoryOpsPass15runOnBasicBlockERN4llvm10BasicBlockE+0x5ba0): undefined reference to `llvm::GenXIntrinsic::getGenXDeclaration(llvm::Module*, llvm::GenXIntrinsic::ID, llvm::ArrayRef<llvm::Type*>)'
/usr/bin/ld: ld-temp.o:(.text._ZN20ImproveMemoryOpsPass15runOnBasicBlockERN4llvm10BasicBlockE+0x5c48): undefined reference to `llvm::GenXIntrinsic::getGenXDeclaration(llvm::Module*, llvm::GenXIntrinsic::ID, llvm::ArrayRef<llvm::Type*>)'
/usr/bin/ld: /tmp/lto-llvm-d034b8.o: in function `llvm::filter_iterator_base<llvm::ilist_iterator<llvm::ilist_detail::node_options<llvm::GlobalVariable, false, false, void>, false, false>, selectGlobalsToLocalize<llvm::iterator_range<llvm::ilist_iterator<llvm::ilist_detail::node_options<llvm::GlobalVariable, false, false, void>, false, false> >, (anonymous namespace)::GlobalsLocalization::AnalyzeGlobals(llvm::CallGraph&)::$_2, int, (anonymous namespace)::GlobalsLocalization::AnalyzeGlobals(llvm::CallGraph&)::$_3>(llvm::iterator_range<llvm::ilist_iterator<llvm::ilist_detail::node_options<llvm::GlobalVariable, false, false, void>, false, false> >, int, (anonymous namespace)::GlobalsLocalization::AnalyzeGlobals(llvm::CallGraph&)::$_2, (anonymous namespace)::GlobalsLocalization::AnalyzeGlobals(llvm::CallGraph&)::$_3)::{lambda(llvm::GlobalVariable&)#1}, std::bidirectional_iterator_tag>::findNextValid()':
ld-temp.o:(.text._ZN4llvm20filter_iterator_baseINS_14ilist_iteratorINS_12ilist_detail12node_optionsINS_14GlobalVariableELb0ELb0EvEELb0ELb0EEEZ23selectGlobalsToLocalizeINS_14iterator_rangeIS6_EEZN12_GLOBAL__N_119GlobalsLocalization14AnalyzeGlobalsERNS_9CallGraphEE3$_2iZNSB_14AnalyzeGlobalsESD_E3$_3ESt6vectorINSt15iterator_traitsIDTclsr3stdE5beginclsr3stdE7declvalIRT_EEEEE7pointerESaISM_EESI_T1_T0_T2_EUlRS4_E_St26bidirectional_iterator_tagE13findNextValidEv+0x29): undefined reference to `llvm::GenXIntrinsic::getGenXIntrinsicID(llvm::Function const*)'

Maybe there is something wrong with vc-intrinsics itself actually?

@jbeich
Copy link
Contributor

jbeich commented Mar 17, 2022

igc-1.0.10409 (with 35c947c backport) builds fine (llvm12, llvm11) on FreeBSD with pre-built vc-intrinsics v0.1.0. ispc used to but FreeBSD support got regressed, so no clue if recent versions still do.

@ArchangeGabriel
Copy link
Contributor

Actually the issue was on our (Arch) side. The issue is that we now enable LTO by default, so vc-intrinsics needs to be built with -ffat-lto-objects to avoid objects being mangled. I’ve just done that and it works (and I guess ispc will work too, looking at that now). So for me this issue can be closed (or maybe once 35c947c is available in a release).

@ArchangeGabriel
Copy link
Contributor

This is now part of the latest release, so should be considered for closing. ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants