search for: poddey

Displaying 20 results from an estimated 20 matches for "poddey".

Did you mean: padded
2015 May 18
2
[LLVMdev] copy value of a global's data field to another global
...m a struct Stuct having double,array(3xint),float fields, I could extract the second int value using the index sequence 0,1,1 with getGetElementPtr. This gives me a constantPointer, but I would need to get a constInt... Alex David Blaikie wrote: > On Sat, May 16, 2015 at 10:28 PM, Alexander Poddey > <alexander.poddey at gmx.net >> wrote: > >> Hi all, >> >> I can get access to the data stored in globals as follows: >> >> GlobalVariable* pGvarAct=_set_a_valid_global_; >> const_ptr_indicesVec=_the_indexes_ >> >> llvm::Constant* pCo...
2015 Mar 18
5
[LLVMdev] casting Constant * to value *?
...(from ConstantExpr::getGetElementPtr) into Instruction->setOperand compiles, but gives me an assertion failure at runtime. I have no access to the code at the moment. I will gather more information possibly tomorrow. Thanks Alex John Criswell wrote: > On 3/17/15 8:40 PM, Alexander Poddey wrote: >> Hi all, >> >> extracting datafields of globals, the API code ends up in a Constant * >> >> >> Constant* const_ptr_103 = ConstantExpr::getGetElementPtr(gvar_struct_foo, >> const_ptr_103_indices); >> >> it can be used to initialize e.g....
2015 Jan 22
3
[LLVMdev] numeric limits of llvm Types?
Hi all, can I access the numeric limits of the llvm types, e.g. HalfTy, FloatTy, DoubleTy, etc. in a fashion like the std numeric_limits tool? std::numeric_limits<half>::min() std::numeric_limits<half>::max() In c++API, I want to initialize values and need to know the correct range for the llvm types.... Thx Alex
2015 Mar 16
4
[LLVMdev] size of const_ptr for array index
Hi all, when e.g. accessing a global variable residing in a structure, the c++API code looks like: std::vector<Constant*> const_ptr_183_indices; const_ptr_183_indices.push_back(const_int32_172); const_ptr_183_indices.push_back(const_int32_184); const_ptr_183_indices.push_back(const_int64_175); Constant* const_ptr_183 = ConstantExpr::getGetElementPtr(gvar_struct_foo,
2015 Mar 10
3
[LLVMdev] Chatty C++API code generation
Hi all, when I have c code like --- c code ------------- struct stest { /* deklariert den Strukturtyp person */ int age; float weight; } foo={44,67.2}; /* deklariert Variable des Typs person */ int main() { callAFunction(foo.weight); ------------------------ The generated c++API code to me seems to be too chatty in the sense that the foo.weight's data
2015 Jan 14
2
[LLVMdev] list of available/valid values near an instruction
...erstand your question correctly, but all values > whose definitions dominate the instruction that you are looking at are > available. Globals and function arguments are always available in a > given module or function. > > -Krzysztof > > > On 1/14/2015 9:08 AM, Alexander Poddey wrote: >> I wonder if there is a list of available/valid values (globals, constants >> arguments,..) in the scope of a given instruction? >> >> Background: >> Iterating over the instructions of a module, i would like to know which >> values are accessible in the...
2015 Mar 28
2
[LLVMdev] LLVMContextImpl.h not installed?
Hi all, I 'd like to fetch a list of structures, and found that it could be done via LLVMContextImpl *pImpl = Context.pImpl; pImpl->AnonStructTypes This however needs the inclusion of LLVMContextImpl.h, which is not contained in the includes dir, but in the lib/IR dir (next to the .cpp files) and is not installed under /usr/local/include... Whats the reason for this? Isn't it
2015 Jan 22
2
[LLVMdev] access IntegerType::getSignBit from Type *
Hi, I have a Type * which may come from an IntegerType as shown below: Type.getIntegerBitWidth() tells me numBits. But how to extract the IntegerType.getSignBit? If pType isIntegerType, I need to know if it is signed or unsigned... How to achieve this? Thx Alex llvm::Type * getRandomValid_IntegerType(llvm::LLVMContext &C) { using namespace llvm; //--- determine num of bits
2015 May 27
2
[LLVMdev] convert GetElemtPtr result to pointer on element?
Hi Tim, I forgot to say that I try to do all this in the LLVM API, not IR. I read in a bc'ed program and try to edit it using the API. Alex Tim Northover wrote: >> But I can not succeed in using the getGetElementPtr result in >> constructing an initalizer for another global value (which expects a >> ConstantFP* and not a ConstantExpr*). > > The result of a
2015 May 17
2
[LLVMdev] copy value of a global's data field to another global
Hi all, I can get access to the data stored in globals as follows: GlobalVariable* pGvarAct=_set_a_valid_global_; const_ptr_indicesVec=_the_indexes_ llvm::Constant* pConst; pConst=ConstantExpr::getGetElementPtr(pGvarAct, const_ptr_indicesVec); and e.g. use this to repalece an argumrnt of an instruction like: I->setOperand(someArgumentIndex,pConst); However, getGetElementPtr returns a
2015 Mar 07
2
[LLVMdev] cannot understand global c++API code
Hi all, translating the following c code to llvm c++Api code, I can not understand the result. Perhaps someone could explain it to me. c code --------------------------------- struct stest { int age; float weight; } foo={44,67.2}; int main() { foo.weight=68.2; ... ---------------------------------------- API code // this is clear ConstantFP* const_float_102 =
2015 Jan 14
2
[LLVMdev] list of available/valid values near an instruction
I wonder if there is a list of available/valid values (globals, constants arguments,..) in the scope of a given instruction? Background: Iterating over the instructions of a module, i would like to know which values are accessible in the context of the instruction, possibly replacing the instructions operand by a valid available other operand. Thx Alex
2015 May 31
1
[LLVMdev] how to get an independent copy of a function?
Hi, I need to get a copy of a function which should be 'selfcontained' (independent from the original function). Just like in C making a copy of a functions source code, changing the name. I tried to copy the basic blocks and their instructions (clone) to a new function, but the module check gives 'referring to an argument in another function'. This seems obvious, because
2015 Mar 17
2
[LLVMdev] casting Constant * to value *?
Hi all, extracting datafields of globals, the API code ends up in a Constant * Constant* const_ptr_103 = ConstantExpr::getGetElementPtr(gvar_struct_foo, const_ptr_103_indices); it can be used to initialize e.g. a new instruction like: StoreInst* void_119 = new StoreInst(const_float_102, const_ptr_103, false, label_entry_113); But how about replacing the operand of an already existing
2015 Jan 12
2
[LLVMdev] debugging opt passed using gdb: could not open input file
Hi all, I would like to be able to debug opt passes. - I compiled llvm in debug mode - gdb /usr/local/bin/opt - run opt -load /path/to/LLVMHello.so -hello <any.bc> /dev/null and then get /usr/local/bin/opt: opt: err: Could not open input file .... could it be the <> syntax is not gdb command window conform? I tried to find out if i could provide opt in and out files using standard
2015 Jan 15
2
[LLVMdev] AllocaInst for FunctionType?
Hi, I'm trying to get my head around c++ - IR - c++ API and getting used tramform manual information to code. The manual states alloca is defined for <type>. FunstionType is a type, so alloca for functionType should be possible? Not? If we have a valid Module *m we can get an allocate instruction allocating space for a non-argumented function as follows: AllocaInst* pa2 = new
2015 Feb 27
1
[LLVMdev] Replacing an initializer
Hi all, suppose I would like to change the initial value of a global. Is the supposed way to change the initializer via const_global_iterator I I->setInitializer(newOne) ? afaik, newOne is a constant - right? Is the original Initializer automatically purged or do I need to delete it? thanks Alex
2015 Jan 22
5
[LLVMdev] Why does "uwtable" prevent optimizing Invoke -> Call?
Hi, in r176827 the optimization that turns invokes with empty landing pads into plain calls was disabled for invocations of function with the "uwtable" attribute. But given this code: struct S { ~S() {}; }; void blackbox(); __attribute__((__noinline__)) void inner() { blackbox(); } int foo() { S s; inner(); return 0; } int bar() {
2015 Feb 27
0
[LLVMdev] using a structs datafield as operand
Hi all, I need to exchange operands of e.g. instructions by others of the same type. Suppose I need to replace a double typed operand; a possible candidate could be a double typed datafield of a struct. The typefinder shows how to recursively crawl types using llvm::Type::subtype_reverse_iterator and thereby compiles a list of types occuring in the module. I could determine when I arrived at
2015 May 26
2
[LLVMdev] convert GetElemtPtr result to pointer on element?
Hi all, I'm still struggling with getElementPtr. I have a global variable (array of doubles). I can use ConstantExpr::getGetElementPtr(myGlobalVariable, indices) and use the result as argument of e.g. a function. I read the GEP docu and know that I need anextra leading '0' index to dereference the global's pointer. So far so good. But I can not succeed in using the