Home
last modified time | relevance | path

Searched full:llvm (Results 1 – 25 of 208) sorted by relevance

123456789

/arkcompiler/runtime_core/static_core/libllvmbackend/lowering/
Dllvm_ir_constructor.h26 #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 …]
Dllvm_ir_constructor.cpp27 #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 …]
Dgc_barriers.h19 #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);
Ddebug_data_builder.cpp18 #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/
Dllvm_ark_interface.h22 #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 …]
Dllvmbackend.yaml15 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 …]
Dmir_compiler.h21 #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 …]
Dmir_compiler.cpp18 #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 …]
Dllvm_compiler.cpp24 #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()
47llvm::report_fatal_error(llvm::Twine("Incompatible LLVM version " + currentLlvmLibVersion + ". " + in LLVMCompiler()
[all …]
Dtarget_machine_builder.cpp19 #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()
30llvm::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/
Dark_inlining.cpp19 #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 …]
Dexpand_atomics.cpp18 #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 …]
Dark_inlining.h19 #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);
41llvm::PreservedAnalyses run(llvm::LazyCallGraph::SCC &component, llvm::CGSCCAnalysisManager & /*un…
42llvm::LazyCallGraph & /*unused*/, llvm::CGSCCUpdateResult & /*unused*/);
45 class InlinePrepare : public llvm::PassInfoMixin<InlinePrepare> {
46 llvm::InlineParams inlineParams_;
[all …]
/arkcompiler/runtime_core/static_core/libllvmbackend/transforms/
Dllvm_optimizer.cpp30 #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 …]
Druntime_calls.cpp19 #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 …]
Druntime_calls.h19 #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/
Dremove_unused_functions.cpp21 #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 …]
Dcleanup_inline_module.cpp24 #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 …]
Dmark_always_inline.cpp20 #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 …]
Dremove_unused_functions.h19 #include <llvm/ADT/DenseSet.h>
20 #include <llvm/IR/PassManager.h>
26 namespace llvm {
30 } // namespace llvm
40 class RemoveUnusedFunctions : public llvm::PassInfoMixin<RemoveUnusedFunctions> {
45llvm::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";
Ddiscard_inline_module.cpp22 #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 …]
Dpatch_return_handler_stack_adjustment.cpp19 #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/
Dbinary_section.h22 #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/
Delf_reader.cpp25llvm::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()
54llvm::ELF::Elf64_Ehdr *ehdr = reinterpret_cast<llvm::ELF::Elf64_Ehdr *>(fileMapMem_.GetOriginAddr(… in ParseELFSections()
[all …]
Delf_reader.h41 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…

123456789