首先这是对一个LTS版本内llvm组件的升级,从7.0升级到8.0.1的话,解决了什么问题? 如果按邮件描述的,”llvm社区对老版本不做维护,社区甚至不会做bugfix”。那升级到8.0.1不解决问题?
其次,要分析下升级的影响范围。 在当前LTS版本内,有哪些软件是直接或者依赖llvm,哪些会因为llvm的升级做相应的变动。 比如llvm升级,compiler-rt, clang不升吗?clang升级,lldb不升吗? 这个升级的变动范围会在哪里截止?
再然后是分析下升级时需要受影响组件做什么变更? 是直接二进制兼容?还是需要重新编译?还是需要代码上做调整?性能有什么影响?功能有什么影响? 这个会需要扩散到本次升级影响范围内的所有包。
当前分析不能支撑TC在会议上做有效讨论。
Regards Xinwei
From: shenyangyang Sent: Monday, August 3, 2020 9:07 PM To: Huxinwei huxinwei@huawei.com; tc@openeuler.org; guoge (A) guoge1@huawei.com Subject: 答复: 请求评审LTS的LLVM升级到8.0.1
从openEuler社区maintainer得知,llvm社区对于老版本是不做维护的,社区甚至不会做bugfix
llvm 8.0.1新增特性:
ORC (On Request Compilation) JIT APIs更新了,支持并发编译,以前的不支持并发编译的接口会被废弃,并且会在LLVM 9以后直接被移除
对AArch64增加了新特性: 支持Speculative Load Hardening(有效防止信息泄露)函数属性 .arch_extension像arm一样增加对汇编指令的支持 开始支持Tiny代码模型
头文件以及abi变更: 1.删除IndirectCallSiteVisitor.h,GCs.h,NativeBuiltinSymbol.h,NativeEnumSymbol.h,TypeBuilder.h,OrderedInstructions.h头文件 2.include\llvm\Analysis\AliasSetTracker.h头文件删除AliasSet &getAliasSetForPointer,AliasSet *getAliasSetForPointerIfExists,bool containsUnknown三个函数;AliasSet &addPointer(Value *P, LocationSize Size, const AAMDNodes &AAInfo,AliasSet::AccessLattice E)变更为 AliasSet &addPointer(MemoryLocation Loc, AliasSet::AccessLattice E)"" 3.include\llvm\Analysis\CmpInstAnalysis.h头文件*getICmpValue(bool Sign, unsigned Code, Value *LHS, Value *RHS,CmpInst::Predicate &NewICmpPred)变更为Constant *getPredForICmpCode(unsigned Code, bool Sign, Type *OpTy,CmpInst::Predicate &Pred); 4.include\llvm\Analysis\DemandedBits.h文件determineLiveOperandBits函数新增参数bool &KnownBitsComputed 5.include\llvm\Analysis\BlockFrequencyInfo.h文件中void view()有默认参数void view(StringRef = ""BlockFrequencyDAGs"") 6.删除了usr/lib64/BugpointPasses.so、LLVMHello.so、TestPlugin.so,新增libOptRemarks.so.8 7.include\llvm\Analysis\MemorySSA.h:createNewAccess(Instruction *)变更为createNewAccess(Instruction *,const MemoryUseOrDef *Template = nullptr);createDefinedAccess(Instruction *, MemoryAccess *)变更为createDefinedAccess(Instruction *, MemoryAccess *,const MemoryUseOrDef *Template = nullptr) 8.include\llvm\Analysis\MemorySSAUpdater.h:wireOldPredecessorsToNewImmediatePredecessor(BasicBlock *Old, BasicBlock *New,ArrayRef<BasicBlock *> Preds)变更为wireOldPredecessorsToNewImmediatePredecessor(BasicBlock *Old, BasicBlock *New, ArrayRef<BasicBlock *> Preds,bool IdenticalEdgesWereMerged = true); 9.Analysis\MustExecute.h文件computeLoopSafetyInfo(LoopSafetyInfo *, Loop *)变更为computeLoopSafetyInfo(const Loop *CurLoop);删除了isGuaranteedToExecute 10.Analysis\Passes.h文件createDivergenceAnalysisPass()变更为createLegacyDivergenceAnalysisPass 11.Analysis\ProfileSummaryInfo.h文件isHotBB变更为isHotBlock;isColdBB变更为isColdBlock 12.include\llvm\Analysis\CaptureTracking.h文件中PointerMayBeCapturedBefore函数新增参数unsigned MaxUsesToExplore = DefaultMaxUsesToExplore 13.Analysis\TypeMetadataUtils.h文件findDevirtualizableCallsForTypeTest函数增加DominatorTree &DT参数 14.BinaryFormat\Dwarf.h文件CallFrameString(unsigned Encoding)变更为CallFrameString(unsigned Encoding, Triple::ArchType Arch) 15.BinaryFormat\Wasm.h删除结构体WasmSignature,新增结构体WasmDylinkInfo;修改结构体WasmSymbolInfo 16.CodeGen\GlobalISel\MachineIRBuilder.h文件删除void recordInsertion、void recordInsertions以及void stopRecordingInsertions函数 17.llvm\CodeGen\GCMetadata.h文件void addSafePoint参数减少了GC::PointKind Kind 18.llvm\CodeGen\MachineFunction.h文件删除addLandingPadInfo函数 19.llvm\CodeGen\MachineInstr.h文件删除了getNumMemOperands、setMemRefs、dropMemRefs函数 20.llvm\CodeGen\MachineScheduler.h文件biasPhysRegCopy变更为biasPhysReg 21.llvm\CodeGen\SlotIndexes.h文件中llvm::sort(idx2MBBMap.begin(), idx2MBBMap.end(), Idx2MBBCompare())变更为llvm::sort(idx2MBBMap, Idx2MBBCompare()) 22.DebugInfo\CodeView\TypeStreamMerger.h文件中mergeTypeAndIdRecords、mergeTypeAndIdRecords、mergeTypeRecords函数均增加一个形参Optional<uint32_t> &PCHSignature 23.llvm\ExecutionEngine\JITEventListener.h文件中删除结构体JITEvent_EmittedFunctionDetails 24.llvm\IR\InstrTypes.h文件删除TerminatorInst、FuncletPadInst类 25.llvm\IR\LegacyPassManager.h文件删除了reportAndResetTimings函数 26.llvm\LTO\LTO.h文件thinLTOResolveWeakForLinkerInIndex函数变更为thinLTOResolvePrevailingInIndex 27.llvm\Object\ELF.h文件将getELFRelrRelocationType变更为getELFRelativeRelocationType,getRelrRelocationType变更为getRelativeRelocationType 28.llvm\ProfileData\InstrProf.h文件llvm::sort函数将MD5NameMap.begin(), MD5NameMap.end()参数变成MD5NameMap 29.Transforms\IPO\FunctionImport.h文件thinLTOResolveWeakForLinkerModule变更为thinLTOResolvePrevailingInModule 30.Transforms\Instrumentation.h文件删除了createMemorySanitizerPass、createThreadSanitizerPass函数 31.Transforms\Scalar.h文件删除了createScalarizerPass函数 32.llvm-c\ExecutionEngine.h文件函数LLVMCreateOprofileJITEventListener变更为LLVMCreateOProfileJITEventListener 33.include\llvm\ADT\StringExtras.h头文件inline std::string toHex(StringRef Input)增加了一个默认参数inline std::string toHex(StringRef Input, bool LowerCase = false) 34.include\llvm\ADT\STLExtras.h删除模板函数template <typename R>auto size
利用abichecker对llvm-libs子包也进行了测试,主要abi变更见下 35./usr/lib64/LLVMgold.so删除了function void onload() 1 Removed function:
'function void onload()' {onload@@LLVM_7} 36."libLTO.so.7到libLTO.so.8移除了67个函数 'function void lto_api_version()' {lto_api_version@@LLVM_7} 'function void lto_codegen_add_module()' {lto_codegen_add_module@@LLVM_7} 'function void lto_codegen_add_must_preserve_symbol()' {lto_codegen_add_must_preserve_symbol@@LLVM_7} 'function void lto_codegen_compile()' {lto_codegen_compile@@LLVM_7} 'function void lto_codegen_compile_optimized()' {lto_codegen_compile_optimized@@LLVM_7} 'function void lto_codegen_compile_to_file()' {lto_codegen_compile_to_file@@LLVM_7} 'function void lto_codegen_create()' {lto_codegen_create@@LLVM_7} 'function void lto_codegen_create_in_local_context()' {lto_codegen_create_in_local_context@@LLVM_7} 'function void lto_codegen_debug_options()' {lto_codegen_debug_options@@LLVM_7} 'function void lto_codegen_dispose()' {lto_codegen_dispose@@LLVM_7} 'function void lto_codegen_optimize()' {lto_codegen_optimize@@LLVM_7} 'function void lto_codegen_set_assembler_args()' {lto_codegen_set_assembler_args@@LLVM_7} 'function void lto_codegen_set_assembler_path()' {lto_codegen_set_assembler_path@@LLVM_7} 'function void lto_codegen_set_cpu()' {lto_codegen_set_cpu@@LLVM_7} 'function void lto_codegen_set_debug_model()' {lto_codegen_set_debug_model@@LLVM_7} 'function void lto_codegen_set_diagnostic_handler()' {lto_codegen_set_diagnostic_handler@@LLVM_7} 'function void lto_codegen_set_module()' {lto_codegen_set_module@@LLVM_7} 'function void lto_codegen_set_pic_model()' {lto_codegen_set_pic_model@@LLVM_7} 'function void lto_codegen_set_should_embed_uselists()' {lto_codegen_set_should_embed_uselists@@LLVM_7} 'function void lto_codegen_set_should_internalize()' {lto_codegen_set_should_internalize@@LLVM_7} 'function void lto_codegen_write_merged_modules()' {lto_codegen_write_merged_modules@@LLVM_7} 'function void lto_get_error_message()' {lto_get_error_message@@LLVM_7} 'function void lto_get_version()' {lto_get_version@@LLVM_7} 'function void lto_initialize_disassembler()' {lto_initialize_disassembler@@LLVM_7} 'function void lto_module_create()' {lto_module_create@@LLVM_7} 'function void lto_module_create_from_fd()' {lto_module_create_from_fd@@LLVM_7} 'function void lto_module_create_from_fd_at_offset()' {lto_module_create_from_fd_at_offset@@LLVM_7} 'function void lto_module_create_from_memory()' {lto_module_create_from_memory@@LLVM_7} 'function void lto_module_create_from_memory_with_path()' {lto_module_create_from_memory_with_path@@LLVM_7} 'function void lto_module_create_in_codegen_context()' {lto_module_create_in_codegen_context@@LLVM_7} 'function void lto_module_create_in_local_context()' {lto_module_create_in_local_context@@LLVM_7} 'function void lto_module_dispose()' {lto_module_dispose@@LLVM_7} 'function void lto_module_get_linkeropts()' {lto_module_get_linkeropts@@LLVM_7} 'function void lto_module_get_num_symbols()' {lto_module_get_num_symbols@@LLVM_7} 'function void lto_module_get_symbol_attribute()' {lto_module_get_symbol_attribute@@LLVM_7} 'function void lto_module_get_symbol_name()' {lto_module_get_symbol_name@@LLVM_7} 'function void lto_module_get_target_triple()' {lto_module_get_target_triple@@LLVM_7} 'function void lto_module_has_objc_category()' {lto_module_has_objc_category@@LLVM_7} 'function void lto_module_is_object_file()' {lto_module_is_object_file@@LLVM_7} 'function void lto_module_is_object_file_for_target()' {lto_module_is_object_file_for_target@@LLVM_7} 'function void lto_module_is_object_file_in_memory()' {lto_module_is_object_file_in_memory@@LLVM_7} 'function void lto_module_is_object_file_in_memory_for_target()' {lto_module_is_object_file_in_memory_for_target@@LLVM_7} 'function void lto_module_is_thinlto()' {lto_module_is_thinlto@@LLVM_7} 'function void lto_module_set_target_triple()' {lto_module_set_target_triple@@LLVM_7} 'function void thinlto_codegen_add_cross_referenced_symbol()' {thinlto_codegen_add_cross_referenced_symbol@@LLVM_7} 'function void thinlto_codegen_add_module()' {thinlto_codegen_add_module@@LLVM_7} 'function void thinlto_codegen_add_must_preserve_symbol()' {thinlto_codegen_add_must_preserve_symbol@@LLVM_7} 'function void thinlto_codegen_disable_codegen()' {thinlto_codegen_disable_codegen@@LLVM_7} 'function void thinlto_codegen_dispose()' {thinlto_codegen_dispose@@LLVM_7} 'function void thinlto_codegen_process()' {thinlto_codegen_process@@LLVM_7} 'function void thinlto_codegen_set_cache_dir()' {thinlto_codegen_set_cache_dir@@LLVM_7} 'function void thinlto_codegen_set_cache_entry_expiration()' {thinlto_codegen_set_cache_entry_expiration@@LLVM_7} 'function void thinlto_codegen_set_cache_pruning_interval()' {thinlto_codegen_set_cache_pruning_interval@@LLVM_7} 'function void thinlto_codegen_set_cache_size_bytes()' {thinlto_codegen_set_cache_size_bytes@@LLVM_7} 'function void thinlto_codegen_set_cache_size_files()' {thinlto_codegen_set_cache_size_files@@LLVM_7} 'function void thinlto_codegen_set_codegen_only()' {thinlto_codegen_set_codegen_only@@LLVM_7} 'function void thinlto_codegen_set_cpu()' {thinlto_codegen_set_cpu@@LLVM_7} 'function void thinlto_codegen_set_final_cache_size_relative_to_available_space()' {thinlto_codegen_set_final_cache_size_relative_to_available_space@@LLVM_7} 'function void thinlto_codegen_set_pic_model()' {thinlto_codegen_set_pic_model@@LLVM_7} 'function void thinlto_codegen_set_savetemps_dir()' {thinlto_codegen_set_savetemps_dir@@LLVM_7} 'function void thinlto_create_codegen()' {thinlto_create_codegen@@LLVM_7} 'function void thinlto_debug_options()' {thinlto_debug_options@@LLVM_7} 'function void thinlto_module_get_num_object_files()' {thinlto_module_get_num_object_files@@LLVM_7} 'function void thinlto_module_get_num_objects()' {thinlto_module_get_num_objects@@LLVM_7} 'function void thinlto_module_get_object()' {thinlto_module_get_object@@LLVM_7} 'function void thinlto_module_get_object_file()' {thinlto_module_get_object_file@@LLVM_7} 'function void thinlto_set_generated_objects_dir()' {thinlto_set_generated_objects_dir@@LLVM_7}, 新增一个函数 'function void thinlto_codegen_set_cache_size_megabytes()' {thinlto_codegen_set_cache_size_megabytes@@LLVM_8}"
从openEuler社区maintainer得知,llvm社区对于老版本是不做维护的,社区甚至不会做bugfix,所以LTS对于llvm应该是需要有演进的,但是从分析来看,确实llvm对外头文件的变更较多,如果一下升级到10.0.0版本,跨度较大,对外兼容性也较差,所以我是建议升级到8.0.1中间版本,该版本对于aarch64有新增一些特性支持。也请llvm openEuler maintainer进行讨论。 发件人: Huxinwei 发送时间: 2020年8月3日 15:44 收件人: shenyangyang <shenyangyang4@huawei.commailto:shenyangyang4@huawei.com>; tc@openeuler.orgmailto:tc@openeuler.org 主题: RE: 请求评审LTS的LLVM升级到8.0.1
选型议题需要给出具体的技术理由
只是版本信息的话,对做出技术抉择没有什么帮助。
From: shenyangyang [mailto:shenyangyang4@huawei.com] Sent: Monday, August 3, 2020 1:13 PM To: tc@openeuler.orgmailto:tc@openeuler.org Subject: [Tc] 请求评审LTS的LLVM升级到8.0.1
当前lts llvm为7.0.0,为2018年9月19日发布版本,较为老旧,希望能够升级到2019年7月19日的8.0.1的版本,到最新版本的话跨度较大,且差异也较多,故而选择中间版本8.0.1。
沈洋洋 庞加莱实验室 [2012实验室] Tel : +86 18958088172 Email : shenyangyang4@huawei.commailto:shenyangyang4@huawei.com [cid:image001.png@01D6076C.F37B6120]
This e-mail and its attachments contain confidential information from HUAWEI, which is intended only for the person or entity whose address is listed above. Any use of the information contained herein in any way (including, but not limited to, total or partial disclosure, reproduction, or dissemination) by persons other than the intended recipient(s) is prohibited. If you receive this e-mail in error, please notify the sender by phone or email immediately and delete it!