search for: llvm_module

Displaying 11 results from an estimated 11 matches for "llvm_module".

2020 Apr 04
2
Running opt O1 outside of llvm
...is also vectorising the code, which doesn't happen when running the same sequence(-S -O1 -reg2mem) through opt. Can someone please help me find what I am missing? Thanks, Akash. * PassManagerBuilder PM; PM.OptLevel = 1; PM.SizeLevel = 0; legacy::FunctionPassManager FPM(&llvm_module); legacy::PassManager MPM; PM.Inliner = createAlwaysInlinerLegacyPass(); PM.DisableUnrollLoops = true; PM.populateFunctionPassManager(FPM); PM.populateModulePassManager(MPM); FPM.doInitialization(); for (auto &F : llvm_module) FPM.run(F); FPM.doFinalization(); MPM.run(llvm_module); legacy::F...
2009 May 15
1
[LLVMdev] Intrinsic
...control by LLVM. In the demo page, I got : declare i8* @llvm.eh.exception() nounwind But, when a try to emit the code by llvm engine, the name is generate with the sufix .132 ( llvm.eh.exception.132 ) and the Function::getIntrinsicID abort the program. It was so : Intrinsic::getDeclaration(llvm_module,Intrinsic::memset,&Tys,1); Now, it's running with this calling : return cast<Function> llvm_module->getOrInsertFunction(std::string("llvm.eh.exception"), Intrinsic::getType(Intrinsic::eh_exception, &Tys,1)) ); Is...
2012 Aug 18
1
[LLVMdev] GlobalVariable initializer using from beyond the grave
For LLDB I'm writing a dumb module pass that removes all global variables, by running the following code: bool erased = true; while (erased) { erased = false; for (Module::global_iterator gi = llvm_module.global_begin(), ge = llvm_module.global_end(); gi != ge; ++gi) { GlobalVariable *global_var = dyn_cast<GlobalVariable>(gi); if (global_var->use_empty()) { log->Printf("Did remove %s"...
2012 Jul 07
2
[LLVMdev] Crash using the JIT on x86 but work on x64
...rt/TargetSelect.h" //#include <cerrno> #include "llvm/DerivedTypes.h" //#include "llvm/Support/DynamicLibrary.h" #include "llvm/Linker.h" //using namespace llvm; llvm::LLVMContext* LLVM_Context; static llvm::ExecutionEngine* LLVM_ExecE = 0; llvm::Module* LLVM_Module; llvm::Type* LLVM_pointerType; bool loadChunk(void* chunk) { llvm::Module* m = (llvm::Module*)chunk; std::string msg; if (llvm::Linker::LinkModules(LLVM_Module, m, llvm::Function::ExternalLinkage, &msg)) { printf("\nLINK ERROR - %s", &msg); } retu...
2018 Jan 20
1
No Targets in TargetRegistry
This is from https://stackoverflow.com/questions/48360685/no-targets-in-targetregistry I have the following code, which should get the default llvm::Target. auto const targetTriple = llvm::sys::getDefaultTargetTriple(); llvm_module.setTargetTriple(targetTriple); std::string error; auto const * target = llvm::TargetRegistry::lookupTarget(targetTriple, error); if (target == nullptr) { auto targets = llvm::TargetRegistry::targets(); size_t targetCount = 0; for (auto const & _ : targets) {...
2013 Sep 03
1
[LLVMdev] X86_thiscall
...uments.push_back(interface_group_ptr); arguments.push_back(any); arguments.push_back(instance_ptr); auto get_interface_type=FunctionType::get(any, arguments, false); interface_group_get_interface=Function::Create(get_interface_type, Function::ExternalLinkage, "get_interface", llvm_module); interface_group_get_interface->setCallingConv(CallingConv::X86_ThisCall); execution_engine->addGlobalMapping(interface_group_get_interface, (void *)as_ptr(&InterfaceGroup::get_interface)); The following call generates the code for the call: vector<Value *> get_interf...
2013 Apr 24
1
[LLVMdev] JIT pass runtime struct on to subroutines
...or a given predicate // at this point there is no struct *machine available // create the function for the predicate. This should take one parameter: the machine-struct that will be provided at runtime when the function is called llvm::Function *llvm_function = llvm::cast<llvm::Function>( llvm_module->getOrInsertFunction(*name, llvm::Type::getVoidTy(&llvm_context), llvm::PointerType::getUnqual(llvm::StructType::create(&llvm_context)), (llvm::Type *)0)); // prepare for the construction of this function llvm::BasicBlock *llvm_basic_block = BasicBlock::Create(&llvm_context, "En...
2009 Mar 24
0
[LLVMdev] va_start
Hi, When I try to use va_start(ptr), I got the following problem : Type *Tys = PointerType::get(IntegerType::get(8), 0); return Intrinsic::getDeclaration(llvm_module,Intrinsic::vastart,&Tys,1); ............... The Name generated is "llvm.va_start.p0i8", so, it's not found, abending the process. and Len = 18 In intrinsics.gen : if (Len == 13 && !memcmp(Name, "llvm.va_start", 13)) return Intrinsic::vastart; Thanks, Manoel...
2009 Mar 24
0
[LLVMdev] va_start
Hi, When I try to use va_start(ptr), I got the following problem : Type *Tys = Type::VoidTy; Or Type *Tys = PointerType::get(IntegerType::get(8), 0); return Intrinsic::getDeclaration(llvm_module,Intrinsic::vastart,&Tys,1); ............... The Name generated is "llvm.va_start.p0i8", so, it's not found, abending the process. and Len = 18 In intrinsics.gen : if (Len == 13 && !memcmp(Name, "llvm.va_start", 13)) return Intrinsic::vastart; Thanks, Manoel...
2005 May 18
1
[LLVMdev] Scheme + LLVM JIT
On May 16, Chris Lattner wrote: > > Sure, that sounds good. I'd definitely prefer that it be tested before it > goes into CVS. Perhaps adding something to llvm/examples would be a good > way to go. > > One suggestion, you might change the API to be something like this: > > ParseAsmString(const char *, Module *) > > Where the function parses the string and
2018 Jan 23
0
MachineVerifier and undef
...;: > >> This is from https://stackoverflow.com/questions/48360685/no-targets- >> in-targetregistry >> >> I have the following code, which should get the default llvm::Target. >> >> auto const targetTriple = llvm::sys::getDefaultTargetTriple(); >> llvm_module.setTargetTriple(targetTriple); >> std::string error; >> auto const * target = llvm::TargetRegistry::lookupTarget(targetTriple, >> error); >> if (target == nullptr) { >> auto targets = llvm::TargetRegistry::targets(); >> size_t targetCo...