similar to: [LLVMdev] AllocaInst issue

Displaying 20 results from an estimated 2000 matches similar to: "[LLVMdev] AllocaInst issue"

2012 Aug 25
2
[LLVMdev] How to Check whether BasicBlock resides in a conditional branch
2012/8/25 Iaroslav Markov <ymarkov at cs.stonybrook.edu>: > Can't you do it by performing some analysis on CFG? You can traverse that structure with BFS. And after that for all the BB you have visited more than once, you try to find a parent that has a branch instruction as a terminator. Additionally you ensure that there are no BB with branches as terminators on your way. If such
2012 Jul 26
1
[LLVMdev] Calling a function with bad signature, possible bug.
Hello, I'm having troubles with writing a pass. In my pass I've have created a function that has two parameters - both of type i8*. Initially I wrote this function in C, that I translated it into IR, and then by using llc -march=cpp I got it's implementation in cpp code that actually inserts IR instructions. Then, I inserted this cpp code in my pass. And in some places of a program
2012 Aug 25
0
[LLVMdev] How to Check whether BasicBlock resides in a conditional branch
Can't you do it by performing some analysis on CFG? You can traverse that structure with BFS. And after that for all the BB you have visited more than once, you try to find a parent that has a branch instruction as a terminator. Additionally you ensure that there are no BB with branches as terminators on your way. If such parent exist, you mark that there is exist a direct connection between
2012 Oct 02
1
[LLVMdev] Error prone default memory capturing convention of blocks.
Hi guys, I've been using blocks for a while and found that current behavior is error prone. So I am going to propose to you the better one. Motivation: 1) The __weak variables in blocks are very common pattern. So having any implicit default behavior makes thing worse. 2) Some stupid mistakes like: __weak typeof (self) theSelf = self; ...^ { theSelf.blabla = .. .... [self blabla];
2011 Jan 22
2
[LLVMdev] Pointers in Load and Store
John, I have looked at the SAFECode and thought following sould work if (isa<Constant>(I.getOperand(0))) { Out << "*** operand 0 is a constant ******"; if (Instruction *operandI = dyn_cast<Instruction>(I.getOperand(0))) { Out << "********operand is an instruction ****"; if (GetElementPtrInst *gepI =
2011 Jan 22
0
[LLVMdev] Pointers in Load and Store
On 1/21/2011 10:46 PM, Surinder wrote: > John, > > I have looked at the SAFECode and thought following sould work > > if (isa<Constant>(I.getOperand(0))) > { Out<< "*** operand 0 is a constant ******"; > if (Instruction *operandI = dyn_cast<Instruction>(I.getOperand(0))) > { Out<<
2011 Jan 23
1
[LLVMdev] Pointers in Load and Store
John, I have looked at the real code (instead of the obsolete one) and it appears to be easy to find if an operand is a getelementptr instruction. if (ConstantExpr * CE = dyn_cast<ConstantExpr>(I.getOperand(0))) { Out<< "*** operand 0 is a constant Expr******"; if (CE->getOpcode() == Instruction::GetElementPtr) { Out<< "*** operand 0 is
2012 Aug 25
6
[LLVMdev] How to Check whether BasicBlock resides in a conditional branch
Hello All, I want to dertermine whether a basicblock is in a conditional branch. such as, //============================= if a > 2 // BasicBlock A then BasicBlock B endif BasicBlock C //============================= What I want to identify is BasicBlock B, which is in a condtional block. but C is not. In other words, I want to distinguish BasicBlocks that * must * be executed and that
2011 Jan 21
0
[LLVMdev] Pointers in Load and Store
On 1/20/2011 10:02 PM, Surinder wrote: > When I compile C programs into llvm, it produces load instructions in > two different flavours. > > (1) %8 = load i8** %bp, align 8 > > (2) %1 = load i8* getelementptr inbounds ([4 x i8]* @.str, i64 0, > i64 0), align 1 > > I know that %bp in first case and the entire "getelementptr inbounds > ([4 x i8]* @.str, i64
2008 Jan 14
1
[LLVMdev] Opaque type
Hello, I'm trying to translate part of Java code in LLVM code. I have some problems with the "opaque type", I think because I did not understand how to use. So, the java code is: int[] ai; .... ai = new int[1]; I am using LLVM API in this way: //I create a pointer of Opaque type, because I don't know yet the array size! OpaqueType* ot = OpaqueType::get(); AllocaInst*
2014 Feb 18
3
[LLVMdev] How to codegen an LLVM-IR that has dynamic arrays in it?
Hi Fellows, Is there a way to allocate dynamic array within an LLVM IR file from my code generator? Say., how to create an array type with a size determined through a global variable. Symbolically, something like below: Value *sz = Mod->getOrInsertGlobal("SIZE", Int32Ty); Type *ArrayTy = ArrayType::get(FloatTy, sz)
2006 Mar 28
2
Typo 2.6.0 broken with Rails 1.1
Updated today, got Typo 2.6.0 broken with Rails 1.1 (Ruby 1.8.4) -- WEBrick does not start. Is there any workaround except "svn co" with Typo trunk? -- Yaroslav Markin yaroslav at markin dot net
2012 Feb 15
2
[LLVMdev] Wrong AliasAnalysis::getModRefInfo result
Just want to test out the LLVM's AliasAnalysis::getModRefInfo API. The input C code is very simple: void foo(int *a, int *b) { for(int i=0; i<10; i++) b[i] = a[i]*a[i]; } int main() { int a[10]; int b[10]; for(int i=0; i<10; i++) a[i] = i; foo(a,b); return 0; } Obviously, for "foo", it only reads from array "a" and only writes to array
2011 Oct 20
2
[LLVMdev] common type at compile time?
I'm a bit confused. For the Type did you mean something like: ArrayType *type = ArrayType::get(Type::getInt8PtrTy(M.getContext()), 4); This does not work, it gives me ""Wrong type in array element initializer" at runtime. Also it doesn't look like ConstantExpr inherits ConstantArray, so I'm not sure how I could use this instead. Thanks On Thu, Oct 20, 2011 at
2010 Feb 17
0
[LLVMdev] Incorrect execution of global constructor with JIT on ARM
On 15 February 2010 14:49, Martins Mozeiko <49640f8a at gmail.com> wrote: > #include <stdio.h> > struct Global { >  typedef unsigned char ArrayType[4]; >  ArrayType value; >  Global(const ArrayType& arg) { >    for (int i = 0; i < 4; i++) this->value[i] = arg[i]; >  } > }; > static const unsigned char arr[] = { 1, 2, 3, 4 }; > static const Global
2011 Oct 20
0
[LLVMdev] common type at compile time?
On 10/20/11 11:34 AM, ret val wrote: > I'm a bit confused. For the Type did you mean something like: > ArrayType *type = ArrayType::get(Type::getInt8PtrTy(M.getContext()), 4); I assume that creates an ArrayType of 4 elements whose elements are pointers to 8-bit values. If so, then this is what I meant. > This does not work, it gives me ""Wrong type in array
2011 Oct 20
0
[LLVMdev] common type at compile time?
On 10/20/11 10:43 AM, ret val wrote: > I'm trying to create a ConstantArray(whose contents will be of types > Function*, GlobalVariable *) so I can immediately create a new > GlobalVariable(that will be in its own section). I'm doing this so I > have these address stored. In order to create this ConstantArray I > need a valid ArrayType, but I'm not sure what to use for
2011 Oct 20
3
[LLVMdev] common type at compile time?
I'm trying to create a ConstantArray(whose contents will be of types Function*, GlobalVariable *) so I can immediately create a new GlobalVariable(that will be in its own section). I'm doing this so I have these address stored. In order to create this ConstantArray I need a valid ArrayType, but I'm not sure what to use for the element type. I want this to be done at compile time, so I
2009 Jun 18
0
[LLVMdev] Initialising global Array
Andreas Neustifter wrote: > Hi, > > I try to create a array that has a nonzero initialiser: > > What i do is, first create the array type. > > > const ArrayType *ATy = ArrayType::get(Type::Int32Ty, NumEdges); > > Then create some constant values for the initializer. > > > std::vector<Constant*> Initializer; Initializer.reserve(NumEdges); > >
2010 Jun 01
2
[LLVMdev] How to create global string array? (user question)
I am trying to create such module with API (it's equivalent to c++: const char* ss[] = {"s1","s2"};): @ss = global [2 x i8*] [i8* getelementptr inbounds ([3 x i8]* @.str1, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8]* @.str2, i32 0, i32 0)] ; <[2 x i8*]*> [#uses=0] @.str1 = private constant [3 x i8] c"s1\00", align 1 ; <[3 x i8]*> [#uses=1]