search for: getdatalayout

Displaying 20 results from an estimated 89 matches for "getdatalayout".

2015 Jun 21
2
[LLVMdev] getAnalysis<DataLayout>() Causing Compilation Error
I’m debugging SAFECode source code files, and in AllocatorInfo.cpp, in the function getObjectSize(Value* V), the function getAnalysis<DataLayout>() is called. I’ve run into this problem before, and the first time I saw it, my employer recommended I use M.getDataLayout() instead, where M was a reference to a Module. However, in getObjectSize(Value* V), there is no Module reference in the list of parameters. Is there a way to obtain a Module affiliated with the Value* argument, which I can then use to call M.getDataLayout? Is there some other way I can get the...
2014 Aug 25
3
[LLVMdev] Module->getDataLayout returns std::string instead of DataLayout
hey, so I'm writing in cpp. the documentation says that TheModule -> getDataLayout should return const DataLayout, but instead it is returning std::string. I require it to return DataLayout, as I generalize my function pass manager to accept the DataLayout constant as an argument, it being the only thing in common amongst both the ExecutionEngine and the Module class. Any poin...
2012 Jun 01
0
[LLVMdev] [llvm-commits] [PATCH] Allow per-thread re-direction of outs()/errs()
...lity to re-direct this output as it sees fit. If no such functionality > is needed, the default behavior is to write to stdout/stderr as it does now. > Perhaps I'm just getting the wrong impression from the current LLVM code base. Take this snippet from LinkModules.cpp: if (!SrcM->getDataLayout().empty() && !DstM->getDataLayout().empty() && SrcM->getDataLayout() != DstM->getDataLayout()) errs() << "WARNING: Linking two modules of different data layouts!\n"; if (!SrcM->getTargetTriple().empty() && DstM->getTargetTripl...
2010 Jul 05
2
[LLVMdev] Data layout hard coded for X86 target
...<clattner at apple.com> writes: > On Jul 5, 2010, at 3:31 AM, Óscar Fuentes wrote: > >> Chris Lattner <clattner at apple.com> writes: >> >>> On Jul 4, 2010, at 6:43 PM, Óscar Fuentes wrote: >>> >>>> In X86Subtarget.h there is a method `getDataLayout' which selects the >>>> data layout depending on the platform, ignoring whatever the user setted >>>> with Module::setDataLayout. >>>> >>>> What's the rationale for this? >>> >>> Data layout is a property of the target, not...
2012 Jun 01
2
[LLVMdev] [llvm-commits] [PATCH] Allow per-thread re-direction of outs()/errs()
On Thu, May 31, 2012 at 8:06 PM, Chris Lattner <clattner at apple.com> wrote: > > On May 31, 2012, at 2:39 PM, Justin Holewinski wrote: > > > The attached patch add the ability to programmatically re-direct > outs()/errs() to an arbitrary raw_ostream instance, maintaining the > raw_ostream instances in a stack structure so clients can push/pop streams > at will. The
2010 Jul 05
2
[LLVMdev] Data layout hard coded for X86 target
Chris Lattner <clattner at apple.com> writes: > On Jul 4, 2010, at 6:43 PM, Óscar Fuentes wrote: > >> In X86Subtarget.h there is a method `getDataLayout' which selects the >> data layout depending on the platform, ignoring whatever the user setted >> with Module::setDataLayout. >> >> What's the rationale for this? > > Data layout is a property of the target, not the program being > compiled. If you don'...
2017 Jul 27
2
llvm 5.0 release rc1 : ExecutionEngine fatal error on MCJIT::getFunctionAddress
...function return 0 (a null address) when the symbol is not found : *uint64_t MCJIT::getSymbolAddress(const std::string &Name, bool CheckFunctionsOnly) { std::string MangledName; { raw_string_ostream MangledNameStream(MangledName); Mangler::getNameWithPrefix(MangledNameStream, Name, getDataLayout()); } return findSymbol(MangledName, CheckFunctionsOnly).getAddress();}* Now with the current implementation (llvm 5.0 rc1 tag) : *uint64_t MCJIT::getSymbolAddress(const std::string &Name, bool CheckFunctionsOnly) { std::string MangledName; { raw_string_ostream MangledN...
2010 Jul 05
0
[LLVMdev] Data layout hard coded for X86 target
On Jul 5, 2010, at 3:31 AM, Óscar Fuentes wrote: > Chris Lattner <clattner at apple.com> writes: > >> On Jul 4, 2010, at 6:43 PM, Óscar Fuentes wrote: >> >>> In X86Subtarget.h there is a method `getDataLayout' which selects the >>> data layout depending on the platform, ignoring whatever the user setted >>> with Module::setDataLayout. >>> >>> What's the rationale for this? >> >> Data layout is a property of the target, not the program being >&...
2016 Jul 28
2
[ORC JIT] Exposing IndirectStubsManager from CompileOnDemandLayer.h
...+ for (auto LDE = LogicalDylibs.end(); LDI != LDE; ++LDI) { + if (auto LMResources = LDI->getLogicalModuleResourcesForSymbol(FuncName, false)) { + Module &SrcM = LMResources->SourceModule->getResource(); + std::string CalledFnName = mangle(FuncName, SrcM.getDataLayout()); + if (auto EC = LMResources->StubsMgr->updatePointer(CalledFnName, FnBodyAddr)) { + return 0; + } + else + return FnBodyAddr; + } + } + return 0; + } + +private: diff --git a/LogicalDylib.h b/LogicalDylib.h ind...
2010 Jul 05
2
[LLVMdev] Data layout hard coded for X86 target
In X86Subtarget.h there is a method `getDataLayout' which selects the data layout depending on the platform, ignoring whatever the user setted with Module::setDataLayout. What's the rationale for this?
2010 Jul 05
0
[LLVMdev] Data layout hard coded for X86 target
...ent of double) is wrong. The hints like the 'native integer >> types' should not cause it to fail. > > Then I guess that the information provided by the user through > Module::setDataLayout is used in some places instead of the hard-coded > info provided by X86SubTarget::getDataLayout. This can cause some > trouble as Anton points out on the discussion of bug #7544. Yes, the target data string is intended to allow the optimizers to do target-specific optimizations before code generation. You can leave it empty if you don't want this to happen. > OTOH, I know that if...
2017 May 22
2
How exactly is datatype alignment determined?
Hi, I'm seeing a bug in the AVR backend that seems to be caused by LLVM thinking things will be aligned to 8 bytes whereas they are unaligned. Specifically, MF->getDataLayout().getPrefTypeAlignment(Ty) returns 8 for the following two types: %opt = type { i8, [0 x i8], [3 x i8] } %Machine = type { i16, [0 x i8], i16, [0 x i8], [16 x i8], [0 x i8] } The target datalayout specifies that pointers are aligned to 8 bits (i.e. unaligned), so I would expect getPrefTypeAlign...
2016 Jul 29
0
[ORC JIT] Exposing IndirectStubsManager from CompileOnDemandLayer.h
...calDylibs.end(); LDI != LDE; ++LDI) { > + if (auto LMResources = > LDI->getLogicalModuleResourcesForSymbol(FuncName, false)) { > + Module &SrcM = LMResources->SourceModule->getResource(); > + std::string CalledFnName = mangle(FuncName, > SrcM.getDataLayout()); > + if (auto EC = > LMResources->StubsMgr->updatePointer(CalledFnName, FnBodyAddr)) { > + return 0; > + } > + else > + return FnBodyAddr; > + } > + } > + return 0; > + } > + >...
2016 Jul 29
2
[ORC JIT] Exposing IndirectStubsManager from CompileOnDemandLayer.h
...!= LDE; ++LDI) { >> + if (auto LMResources = >> LDI->getLogicalModuleResourcesForSymbol(FuncName, false)) { >> + Module &SrcM = LMResources->SourceModule->getResource(); >> + std::string CalledFnName = mangle(FuncName, >> SrcM.getDataLayout()); >> + if (auto EC = >> LMResources->StubsMgr->updatePointer(CalledFnName, FnBodyAddr)) { >> + return 0; >> + } >> + else >> + return FnBodyAddr; >> + } >> + } >> +...
2016 Sep 19
3
llvm interpreter does not find function defined by addGlobalMapping
...ot;a module", context); // Here the EngineKind-flag decides if JIT or interpreter is used. auto pExecutionEngine = llvm::EngineBuilder(std::unique_ptr<llvm::Module>(pModule) ).setEngineKind(llvm::EngineKind::Interpreter).create(); pModule->setDataLayout(pExecutionEngine->getDataLayout()); // declaration of the c function. std::vector<llvm::Type *> noArgTypes; llvm::FunctionType* ft = llvm::FunctionType::get(llvm::Type::getDoubleTy(context),noArgTypes, false); auto pFunction = llvm::Function::Create(ft, llvm::Function::ExternalLinkage, "testFunction",pMod...
2012 Jun 01
3
[LLVMdev] [llvm-commits] [PATCH] Allow per-thread re-direction of outs()/errs()
...arnings to some compiler-controlled stream for message triaging. Yes, this is broken. The fix should be in the linker though, not in errs(). > Perhaps I'm just getting the wrong impression from the current LLVM code base. Take this snippet from LinkModules.cpp: > > if (!SrcM->getDataLayout().empty() && !DstM->getDataLayout().empty() && > SrcM->getDataLayout() != DstM->getDataLayout()) > errs() << "WARNING: Linking two modules of different data layouts!\n"; > if (!SrcM->getTargetTriple().empty() && > Dst...
2016 Feb 05
4
MCJit Runtine Performance
Hi Morten, Something else just occurred to me: can you share your EngineBuilder configuration lines? (http://llvm.org/docs/doxygen/html/classllvm_1_1EngineBuilder.html) In particular - are you explicitly setting the optimization level? The old JIT may have had a different default. - Lang. Sent from my iPad > On Feb 4, 2016, at 10:54 PM, Jim Grosbach via llvm-dev <llvm-dev at
2012 Oct 17
2
[LLVMdev] a bug in Kaleidoscope code
...#include "llvm/Support/IRBuilder.h" then i compiled again, but got another error: $ clang++ -g toy.cpp `llvm-config --cppflags --ldflags --libs core jit native` -O3 -o toy toy.cpp:1115:18: error: unknown type name 'DataLayout' OurFPM.add(new DataLayout(*TheExecutionEngine->getDataLayout())); this is due to the removal of DataLayout structure from 3.1. how can i fix this bug? thanks, Jun
2018 Apr 19
2
How to set Target/Triple of ExecutionEngine
...       setErrorStr( &errStr ).         setEngineKind( llvm::EngineKind::JIT ).         setTargetOptions( topts ).         create(builder.selectTarget( llvm::Triple(llvm::Triple::normalize(platform::target->triple)), "", "", mattrs ));     module->setDataLayout( ee->getDataLayout() ); Where `module` is my `llvm::Module` with the generated IR code. I'm using the triple `x86_64-pc-linux-gnu`, the same as clang on the machine, but getting different alignments. I'm assuming the above is somehow not creating the correct layout. Perhaps there's an ordering issue? -...
2016 Jul 29
0
[ORC JIT] Exposing IndirectStubsManager from CompileOnDemandLayer.h
...t;>> + if (auto LMResources = >>> LDI->getLogicalModuleResourcesForSymbol(FuncName, false)) { >>> + Module &SrcM = LMResources->SourceModule->getResource(); >>> + std::string CalledFnName = mangle(FuncName, >>> SrcM.getDataLayout()); >>> + if (auto EC = >>> LMResources->StubsMgr->updatePointer(CalledFnName, FnBodyAddr)) { >>> + return 0; >>> + } >>> + else >>> + return FnBodyAddr; >>> +...