| /arkcompiler/runtime_core/static_core/libllvmbackend/lowering/ |
| D | llvm_ir_constructor.h | 26 #include <llvm/IR/Function.h> 27 #include <llvm/IR/IRBuilder.h> 49 llvm::Value *GetMappedValue(Inst *inst, DataType::Type type); 50 llvm::Value *GetInputValue(Inst *inst, size_t index, bool skipCoerce = false); 51 llvm::Value *GetInputValueFromConstant(ConstantInst *constant, DataType::Type pandaType); 58 llvm::Function *GetFunc() in GetFunc() 77 llvm::Value *CreateBinaryOp(Inst *inst, llvm::Instruction::BinaryOps opcode); 78 llvm::Value *CreateBinaryImmOp(Inst *inst, llvm::Instruction::BinaryOps opcode, uint64_t c); 79 llvm::Value *CreateShiftOp(Inst *inst, llvm::Instruction::BinaryOps opcode); 80 llvm::Value *CreateSignDivMod(Inst *inst, llvm::Instruction::BinaryOps opcode); [all …]
|
| D | llvm_ir_constructor.cpp | 27 #include <llvm/IR/InlineAsm.h> 28 #include <llvm/IR/IntrinsicsAArch64.h> 29 #include <llvm/IR/MDBuilder.h> 30 #include <llvm/IR/Verifier.h> 31 #include <llvm/Transforms/Utils/BasicBlockUtils.h> 70 inline llvm::Function *CreateFunctionDeclaration(llvm::FunctionType *functionType, const std::strin… in CreateFunctionDeclaration() 71 llvm::Module *module) in CreateFunctionDeclaration() 79 ASSERT(function->getVisibility() == llvm::GlobalValue::ProtectedVisibility); in CreateFunctionDeclaration() 84 function = llvm::Function::Create(functionType, llvm::Function::ExternalLinkage, name, module); in CreateFunctionDeclaration() 89 function->setVisibility(llvm::GlobalValue::ProtectedVisibility); in CreateFunctionDeclaration() [all …]
|
| D | gc_barriers.h | 19 #include <llvm/IR/IRBuilder.h> 26 void EmitPreWRB(llvm::IRBuilder<> *builder, llvm::Value *mem, bool isVolatileMem, llvm::BasicBlock … 27 LLVMArkInterface *arkInterface, llvm::Value *threadRegValue); 29 void EmitPostWRB(llvm::IRBuilder<> *builder, llvm::Value *mem, llvm::Value *offset, llvm::Value *va… 30 … LLVMArkInterface *arkInterface, llvm::Value *threadRegValue, llvm::Value *frameRegValue);
|
| D | debug_data_builder.cpp | 18 #include <llvm/IR/Module.h> 19 #include <llvm/IR/Function.h> 20 #include <llvm/IR/DIBuilder.h> 24 using llvm::DIBuilder; 25 using llvm::DICompileUnit; 26 using llvm::DILocation; 27 using llvm::DISubprogram; 28 using llvm::Function; 29 using llvm::Instruction; 31 DebugDataBuilder::DebugDataBuilder(llvm::Module *module, const std::string &filename) : builder_(ne… in DebugDataBuilder() [all …]
|
| /arkcompiler/runtime_core/static_core/libllvmbackend/ |
| D | llvm_ark_interface.h | 22 #include <llvm/ADT/DenseMap.h> 23 #include <llvm/ADT/Triple.h> 24 #include <llvm/ADT/StringMap.h> 25 #include <llvm/IR/IRBuilder.h> 26 #include <llvm/IR/ValueMap.h> 27 #include <llvm/IR/Intrinsics.h> 28 #include <llvm/Support/AtomicOrdering.h> 30 #include "llvm/IR/Instructions.h" 32 namespace llvm { 37 } // namespace llvm [all …]
|
| D | llvmbackend.yaml | 15 name: llvm 17 descritpition: LLVM AOT compiler for panda 20 - name: llvm-dump-before 23 description: Whether generated LLVM module should be dumped before optimization passes are run 24 - name: llvm-dump-after 27 description: Whether generated LLVM module should be dumped after optimization passes are run 28 - name: llvm-log 39 description: Set log llvm components 41 - name: llvm-pipeline 45 File with a sequence of llvm's passes, that will be involved into optimization [all …]
|
| D | mir_compiler.h | 21 #include <llvm/IR/LegacyPassManager.h> 22 #include <llvm/Pass.h> 23 #include <llvm/Target/TargetMachine.h> 29 class InsertingPassManager : public llvm::legacy::PassManager { 31 void add(llvm::Pass *p) override; 33 void InsertBefore(llvm::AnalysisID before, llvm::Pass *pass) in InsertBefore() 39 std::unordered_map<llvm::AnalysisID, llvm::Pass *> befores_; 47 std::shared_ptr<llvm::TargetMachine> targetMachine, PassInserterFunction insertPasses, 48 …CreatedObjectFile::ObjectFilePostProcessor objectFilePostProcessor = [](llvm::object::ObjectFile *… 55 llvm::Expected<std::unique_ptr<CreatedObjectFile>> CompileModule(llvm::Module &module); [all …]
|
| D | mir_compiler.cpp | 18 #include <llvm/Analysis/TargetTransformInfo.h> 19 #include <llvm/MC/TargetRegistry.h> 20 #include <llvm/Object/ObjectFile.h> 21 #include <llvm/Support/SmallVectorMemoryBuffer.h> 25 void InsertingPassManager::add(llvm::Pass *p) in add() 32 llvm::legacy::PassManager::add(p); in add() 35 llvm::Expected<std::unique_ptr<CreatedObjectFile>> MIRCompiler::CompileModule(llvm::Module &module) in CompileModule() 37 llvm::SmallVector<char, 0> rawBuffer; in CompileModule() 39 llvm::raw_svector_ostream rawStream(rawBuffer); in CompileModule() 47 … manager.add(llvm::createTargetTransformInfoWrapperPass(targetMachine_->getTargetIRAnalysis())); in CompileModule() [all …]
|
| D | llvm_compiler.cpp | 24 #include <llvm/Config/llvm-config.h> 25 #include <llvm/ExecutionEngine/Interpreter.h> 26 #include <llvm/InitializePasses.h> 27 #include <llvm/MC/TargetRegistry.h> 28 #include <llvm/PassRegistry.h> 29 #include <llvm/Support/CommandLine.h> 30 #include <llvm/Support/StringSaver.h> 41 // LLVM_VERSION_STRING is defined in llvm-config.h in LLVMCompiler() 45 const std::string currentLlvmLibVersion = llvm::LLVMContext::getLLVMVersion(); in LLVMCompiler() 47 … llvm::report_fatal_error(llvm::Twine("Incompatible LLVM version " + currentLlvmLibVersion + ". " + in LLVMCompiler() [all …]
|
| D | target_machine_builder.cpp | 19 #include <llvm/MC/TargetRegistry.h> 23 llvm::Expected<std::unique_ptr<llvm::TargetMachine>> TargetMachineBuilder::Build() in Build() 25 ASSERT(triple_.getArch() != llvm::Triple::UnknownArch && "Triple's arch must be set"); in Build() 27 auto target = llvm::TargetRegistry::lookupTarget("", triple_, error); in Build() 29 return llvm::createStringError(llvm::inconvertibleErrorCode(), in Build() 30 … llvm::StringRef {"Could not lookupTarget by triple = '"} + triple_.str() + in Build() 35 llvm::TargetOptions targetOptions {}; in Build() 36 …target->createTargetMachine(triple_.getTriple(), cpu_, features_, targetOptions, llvm::Reloc::PIC_, in Build() 37 llvm::CodeModel::Small, optlevel_); in Build() 39 return std::unique_ptr<llvm::TargetMachine>(machine); in Build() [all …]
|
| /arkcompiler/runtime_core/static_core/libllvmbackend/transforms/passes/ |
| D | ark_inlining.cpp | 19 #include <llvm/Analysis/InlineAdvisor.h> 20 #include <llvm/Analysis/ReplayInlineAdvisor.h> 22 #include <llvm/IR/InstIterator.h> 23 #include <llvm/IR/Instructions.h> 24 #include <llvm/IR/IntrinsicInst.h> 25 #include <llvm/Demangle/Demangle.h> 40 auto inlineParams = llvm::getInlineParams(INLINING_THRESHOLD); in Create() 45 llvm::PreservedAnalyses InlinePrepare::run(llvm::Module &module, llvm::ModuleAnalysisManager &modul… in run() 47 auto &advisorResult = moduleAm.getResult<llvm::InlineAdvisorAnalysis>(module); in run() 49 inlineParams_, llvm::InliningAdvisorMode::Default, {}, in run() [all …]
|
| D | expand_atomics.cpp | 18 #include <llvm/ADT/STLExtras.h> 19 #include <llvm/IR/Instructions.h> 30 llvm::PreservedAnalyses ExpandAtomics::run(llvm::Function &function, in run() 31 … [[maybe_unused]] llvm::FunctionAnalysisManager &analysisManager) in run() 35 if (llvm::Triple {function.getParent()->getTargetTriple()}.getArch() != llvm::Triple::x86_64) { in run() 36 return llvm::PreservedAnalyses::all(); in run() 41 llvm::SmallVector<llvm::Instruction *> instructions; in run() 54 return changed ? llvm::PreservedAnalyses::none() : llvm::PreservedAnalyses::all(); in run() 57 bool ExpandAtomics::InsertAddrSpaceCast(llvm::Instruction *atomicInstruction) in InsertAddrSpaceCast() 60 if (llvm::isa<llvm::FenceInst>(atomicInstruction)) { in InsertAddrSpaceCast() [all …]
|
| D | ark_inlining.h | 19 #include <llvm/Transforms/IPO/Inliner.h> 20 #include <llvm/Target/TargetMachine.h> 21 #include <llvm/IR/PassManager.h> 33 class IrtocInlineChecker : public llvm::PassInfoMixin<IrtocInlineChecker> { 35 static constexpr llvm::StringRef ARG_NAME = "irtoc-inline-check"; 38 void CheckShouldInline(llvm::CallBase *callBase); 41 …llvm::PreservedAnalyses run(llvm::LazyCallGraph::SCC &component, llvm::CGSCCAnalysisManager & /*un… 42 … llvm::LazyCallGraph & /*unused*/, llvm::CGSCCUpdateResult & /*unused*/); 45 class InlinePrepare : public llvm::PassInfoMixin<InlinePrepare> { 46 llvm::InlineParams inlineParams_; [all …]
|
| /arkcompiler/runtime_core/static_core/libllvmbackend/transforms/ |
| D | llvm_optimizer.cpp | 30 #include <llvm/Analysis/AliasAnalysis.h> 31 #include <llvm/Analysis/GlobalsModRef.h> 32 #include <llvm/Analysis/TargetLibraryInfo.h> 33 #include <llvm/Analysis/ProfileSummaryInfo.h> 34 #include <llvm/Transforms/Utils/CanonicalizeAliases.h> 35 #include <llvm/Transforms/Utils/NameAnonGlobals.h> 36 #include <llvm/Passes/PassBuilder.h> 37 #include <llvm/Passes/StandardInstrumentations.h> 38 #include <llvm/IR/Verifier.h> 39 #include <llvm/Target/TargetMachine.h> [all …]
|
| D | runtime_calls.cpp | 19 #include <llvm/IR/IRBuilder.h> 25 llvm::Value *GetAddressToTLS(llvm::IRBuilder<> *builder, LLVMArkInterface *arkInterface, uintptr_t … in GetAddressToTLS() 32 llvm::Value *LoadTLSValue(llvm::IRBuilder<> *builder, LLVMArkInterface *arkInterface, uintptr_t tls… in LoadTLSValue() 33 llvm::Type *type) in LoadTLSValue() 39 llvm::CallInst *CreateEntrypointCallCommon(llvm::IRBuilder<> *builder, llvm::Value *threadRegValue, in CreateEntrypointCallCommon() 41 llvm::ArrayRef<llvm::Value *> arguments) in CreateEntrypointCallCommon() 50 auto calleeFuncTy = llvm::cast<llvm::FunctionType>(function_proto); in CreateEntrypointCallCommon() 55 llvm::Value *GetThreadRegValue(llvm::IRBuilder<> *builder, LLVMArkInterface *arkInterface) in GetThreadRegValue() 60 …auto regMd = llvm::MDNode::get(ctx, {llvm::MDString::get(ctx, arkInterface->GetThreadRegister())}); in GetThreadRegValue() 61 auto threadReg = llvm::MetadataAsValue::get(ctx, regMd); in GetThreadRegValue() [all …]
|
| D | runtime_calls.h | 19 #include <llvm/IR/Function.h> 20 #include <llvm/IR/Instructions.h> 21 #include <llvm/IR/IRBuilder.h> 31 llvm::Value *GetAddressToTLS(llvm::IRBuilder<> *builder, LLVMArkInterface *arkInterface, uintptr_t … 32 llvm::Value *LoadTLSValue(llvm::IRBuilder<> *builder, LLVMArkInterface *arkInterface, uintptr_t tls… 33 llvm::Type *type); 36 llvm::CallInst *CreateEntrypointCallCommon(llvm::IRBuilder<> *builder, llvm::Value *threadRegValue, 38 llvm::ArrayRef<llvm::Value *> arguments = llvm::None); 40 llvm::Value *GetThreadRegValue(llvm::IRBuilder<> *builder, LLVMArkInterface *arkInterface); 41 llvm::Value *GetRealFrameRegValue(llvm::IRBuilder<> *builder, LLVMArkInterface *arkInterface);
|
| /arkcompiler/runtime_core/static_core/libllvmbackend/transforms/passes/inline_ir/ |
| D | remove_unused_functions.cpp | 21 #include <llvm/Pass.h> 22 #include <llvm/IR/InlineAsm.h> 23 #include <llvm/IR/Module.h> 24 #include <llvm/IR/Verifier.h> 25 #include <llvm/Transforms/Utils/BasicBlockUtils.h> 26 #include <llvm/Transforms/IPO/FunctionImport.h> 30 using llvm::Argument; 31 using llvm::BasicBlock; 32 using llvm::cast; 33 using llvm::convertToDeclaration; [all …]
|
| D | cleanup_inline_module.cpp | 24 #include <llvm/IR/Function.h> 25 #include <llvm/IR/Module.h> 26 #include <llvm/IR/ValueSymbolTable.h> 27 #include <llvm/Pass.h> 28 #include <llvm/Support/Debug.h> 29 #include <llvm/Transforms/IPO/FunctionImport.h> 30 #include <llvm/Transforms/Utils/FunctionImportUtils.h> 36 using llvm::Argument; 37 using llvm::BasicBlock; 38 using llvm::cast; [all …]
|
| D | mark_always_inline.cpp | 20 #include <llvm/Pass.h> 21 #include <llvm/IR/InlineAsm.h> 22 #include <llvm/IR/Instructions.h> 23 #include <llvm/IR/Module.h> 24 #include <llvm/IR/Verifier.h> 25 #include <llvm/Transforms/Utils/BasicBlockUtils.h> 26 #include <llvm/Transforms/IPO/FunctionImport.h> 32 using llvm::Attribute; 33 using llvm::AttributeList; 34 using llvm::CallInst; [all …]
|
| D | remove_unused_functions.h | 19 #include <llvm/ADT/DenseSet.h> 20 #include <llvm/IR/PassManager.h> 26 namespace llvm { 30 } // namespace llvm 40 class RemoveUnusedFunctions : public llvm::PassInfoMixin<RemoveUnusedFunctions> { 45 … llvm::PreservedAnalyses run(llvm::Module &module, llvm::ModuleAnalysisManager &analysis_manager); 48 void VisitValue(llvm::DenseSet<llvm::Function *> &usedFunctions, llvm::Value &value, 49 llvm::DenseSet<llvm::Value *> &seenValues); 52 static constexpr llvm::StringRef ARG_NAME = "remove-unused-functions";
|
| D | discard_inline_module.cpp | 22 #include <llvm/IR/Module.h> 23 #include <llvm/IR/Function.h> 24 #include <llvm/Pass.h> 25 #include <llvm/Support/Debug.h> 26 #include <llvm/Transforms/IPO/FunctionImport.h> 30 using llvm::convertToDeclaration; 40 llvm::PreservedAnalyses DiscardInlineModule::run(llvm::Module &module, llvm::ModuleAnalysisManager … in run() 47 return changed ? llvm::PreservedAnalyses::none() : llvm::PreservedAnalyses::all(); in run() 49 bool DiscardInlineModule::DiscardIfNecessary(llvm::GlobalObject *object) in DiscardIfNecessary() 53 LLVM_DEBUG(llvm::dbgs() << "Removed '" << object->getName() << "'\n"); in DiscardIfNecessary() [all …]
|
| D | patch_return_handler_stack_adjustment.cpp | 19 #include <llvm/ADT/SmallVector.h> 20 #include <llvm/CodeGen/GlobalISel/MachineIRBuilder.h> 21 #include <llvm/CodeGen/MachineFrameInfo.h> 22 #include <llvm/CodeGen/MachineFunctionPass.h> 23 #include <llvm/CodeGen/MachineModuleInfo.h> 24 #include <llvm/IR/IRBuilder.h> 25 #include <llvm/Support/Debug.h> 29 using llvm::MachineFunction; 30 using llvm::MachineFunctionPass; 31 using llvm::RegisterPass; [all …]
|
| /arkcompiler/ets_runtime/ecmascript/compiler/ |
| D | binary_section.h | 22 #include "llvm/BinaryFormat/ELF.h" 154 … {ElfSecName::RODATA, {llvm::ELF::SHT_PROGBITS, llvm::ELF::SHF_ALLOC | llvm::ELF::SHF_MERGE}}, in InitShTypeAndFlag() 155 … {ElfSecName::RODATA_CST4, {llvm::ELF::SHT_PROGBITS, llvm::ELF::SHF_ALLOC | llvm::ELF::SHF_MERGE}}, in InitShTypeAndFlag() 156 … {ElfSecName::RODATA_CST8, {llvm::ELF::SHT_PROGBITS, llvm::ELF::SHF_ALLOC | llvm::ELF::SHF_MERGE}}, in InitShTypeAndFlag() 157 …{ElfSecName::RODATA_CST16, {llvm::ELF::SHT_PROGBITS, llvm::ELF::SHF_ALLOC | llvm::ELF::SHF_MERGE}}, in InitShTypeAndFlag() 158 …{ElfSecName::RODATA_CST32, {llvm::ELF::SHT_PROGBITS, llvm::ELF::SHF_ALLOC | llvm::ELF::SHF_MERGE}}, in InitShTypeAndFlag() 159 … {ElfSecName::TEXT, {llvm::ELF::SHT_PROGBITS, llvm::ELF::SHF_ALLOC | llvm::ELF::SHF_EXECINSTR}}, in InitShTypeAndFlag() 160 …{ElfSecName::ARK_ASMSTUB, {llvm::ELF::SHT_PROGBITS, llvm::ELF::SHF_ALLOC | llvm::ELF::SHF_EXECINST… in InitShTypeAndFlag() 161 … {ElfSecName::DATA, {llvm::ELF::SHT_PROGBITS, llvm::ELF::SHF_ALLOC | llvm::ELF::SHF_WRITE}}, in InitShTypeAndFlag() 162 … {ElfSecName::GOT, {llvm::ELF::SHT_PROGBITS, llvm::ELF::SHF_ALLOC | llvm::ELF::SHF_WRITE}}, in InitShTypeAndFlag() [all …]
|
| /arkcompiler/ets_runtime/ecmascript/compiler/aot_file/ |
| D | elf_reader.cpp | 25 …llvm::ELF::Elf64_Ehdr header = *(reinterpret_cast<llvm::ELF::Elf64_Ehdr *>(fileMapMem_.GetOriginAd… in VerifyELFHeader() 26 if (header.e_ident[llvm::ELF::EI_MAG0] != llvm::ELF::ElfMagic[llvm::ELF::EI_MAG0] in VerifyELFHeader() 27 || header.e_ident[llvm::ELF::EI_MAG1] != llvm::ELF::ElfMagic[llvm::ELF::EI_MAG1] in VerifyELFHeader() 28 || header.e_ident[llvm::ELF::EI_MAG2] != llvm::ELF::ElfMagic[llvm::ELF::EI_MAG2] in VerifyELFHeader() 29 || header.e_ident[llvm::ELF::EI_MAG3] != llvm::ELF::ElfMagic[llvm::ELF::EI_MAG3]) { in VerifyELFHeader() 30 LOG_ECMA(ERROR) << "ELF format error, expected magic is " << llvm::ELF::ElfMagic in VerifyELFHeader() 31 … << ", but got " << header.e_ident[llvm::ELF::EI_MAG0] << header.e_ident[llvm::ELF::EI_MAG1] in VerifyELFHeader() 32 << header.e_ident[llvm::ELF::EI_MAG2] << header.e_ident[llvm::ELF::EI_MAG3]; in VerifyELFHeader() 45 ModuleSectionDes::ModuleRegionInfo *ElfReader::GetCurModuleInfo(uint32_t i, llvm::ELF::Elf64_Off of… in GetCurModuleInfo() 54 …llvm::ELF::Elf64_Ehdr *ehdr = reinterpret_cast<llvm::ELF::Elf64_Ehdr *>(fileMapMem_.GetOriginAddr(… in ParseELFSections() [all …]
|
| D | elf_reader.h | 41 ModuleSectionDes::ModuleRegionInfo *GetCurModuleInfo(uint32_t i, llvm::ELF::Elf64_Off offset); 43 llvm::ELF::Elf64_Off &secOffset, const llvm::ELF::Elf64_Off &moduleInfoOffset); 45 llvm::ELF::Elf64_Off &secOffset, const llvm::ELF::Elf64_Off &moduleInfoOffset); 47 llvm::ELF::Elf64_Off &secOffset, const llvm::ELF::Elf64_Off &moduleInfoOffset); 49 llvm::ELF::Elf64_Off &secOffset, const llvm::ELF::Elf64_Off &moduleInfoOffset); 51 …const uint64_t &secAddr, llvm::ELF::Elf64_Off &secOffset, const llvm::ELF::Elf64_Off &curShOffset); 53 …const uint64_t &secAddr, llvm::ELF::Elf64_Off &secOffset, const llvm::ELF::Elf64_Off &curShOffset); 55 …const uintptr_t &secAddr, llvm::ELF::Elf64_Off &secOffset, const llvm::ELF::Elf64_Off &curShOffset… 57 …const uintptr_t &secAddr, llvm::ELF::Elf64_Off &secOffset, const llvm::ELF::Elf64_Off &curShOffset…
|