similar to: [LLVMdev] How can i differentiate pointer type int 32* from int 32** ?

Displaying 20 results from an estimated 5000 matches similar to: "[LLVMdev] How can i differentiate pointer type int 32* from int 32** ?"

2015 Jul 17
2
[LLVMdev] How can i differentiate pointer type int 32* from int 32** ?
John, thanks for you answer! But as far as I know LLVM doesn't provide any interface for finding the pointee of a pointer directly, so i have to process a multi-level pointer i need to write my own function to check pointers level by level, is that right? On Fri, Jul 17, 2015 at 1:47 PM, John Criswell <jtcriswel at gmail.com> wrote: > On 7/17/15 12:38 PM, Shen Liu wrote: > >
2015 Jul 18
4
[LLVMdev] How can i differentiate pointer type int 32* from int 32** ?
John, thanks for your helpful advice. My ultimate goal is to construct a full instruction-level program dependence graph for a given IR file. The hard point is how to establish the correct data dependence edges when some function arguments are multi-level pointers. To solve this problem I hope to check the point-to level for each pointer variable. I think the data dependence through pointers can
2015 Apr 29
2
[LLVMdev] AliasAnalysis calling failed in Pass interaction
Dear LLVM developers, I am Shen, a PhD student at Lehigh Univ. PA. Now I am implementing a Program Dependence Graph(PDG) on LLVM. I have 4 passes here: 1. ProgramDependenceGraph (a *ModulePass *on the highest level) 2. DataDependenceGraph (a Intermediate *FunctionPass*). 3. FlowDependenceAnalysis Pass (a intermediate *FunctionPass*) which uses llvm built-in AliasAnalysis (-basicaa) 4.
2015 Jul 09
2
[LLVMdev] How to use get the memory location of a function argument correctly?
Hi all, i hope to get the MemoryLocation for argument %1 in a CallInst like "call void @function(i32* %1)", and i found an interface "getForArgument()" which seems available for this. However, i don't know how to correcly fill the 3rd argument TargetLibraryInfo in my own code and can't find an example in google. Does anybody know how to do it? Or some other advice for
2012 Sep 21
0
[LLVMdev] How To Get The Name of the type the popinter is pointing to
i am using llvm , i did this if ( AllocaInst *allocInst = dyn_cast<AllocaInst>(&*bbit)){ PointerType *p = allocInst->getType(); if ( p->getElementType()->isPointerTy()){ StringRef name = allocInst->getName();
2011 Jun 06
2
[LLVMdev] Explanation
Hi All, I am trying to check if a Value type is a int32 pointer by using if(T == Type::getInt1PtrTy(Context, AS)) ... I am trying to understand the AS (address space). How do I get it? Thanks. George * * -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110606/775e4f09/attachment.html>
2012 Sep 20
5
[LLVMdev] How To Get The Name of the type the popinter is pointing to
I want to know the type of pointer . for example if we have int *p, struct node *w char *q then i want int for p,char for q , struct node for w. any help would be appreciated. -- View this message in context: http://llvm.1065342.n5.nabble.com/How-To-Get-The-Name-of-the-type-the-popinter-is-pointing-to-tp49121.html Sent from the LLVM - Dev mailing list archive at Nabble.com.
2011 Jun 06
0
[LLVMdev] Explanation
On 6 June 2011 17:08, George Baah <georgebaah at gmail.com> wrote: > if(T == Type::getInt1PtrTy(Context, AS)) ... Hi, You don't need to care about address spaces to check for an int32*: if (T->isPointerTy()) { const Type* intT = cast<PointerType>(T)->getElementType(); if (intT->isIntegerTy() && intT->getPrimitiveSizeInBits() == 32) cout <<
2015 Nov 13
5
How to efficiently extract the calledFunction from a complex CallInst?
Hi all, Usually if we want to get the called Function we can directly use CallInst->getCalledFunction(), however, today i encounter an unusual CallInst as follows: %call11 = call double (...)* bitcast (double ()* @quantum_frand to double (...)*)() the original C source involve type cast: float u,v; extern double quantum_frand(); u = 2 * quantum_frand() - 1; v = 2 * quantum_frand() -
2011 Sep 22
3
[LLVMdev] Need help in converting int to double
Hi, I'm pursuing M.Tech course. As a part of the project work i'm using LLVM as back-end. My project area is "Enhancing the performance of V8 javascript engine using LLVM as a back-end". Now i'm writing code for shift left(SHL) operator. I had my own Value Structure .. it's like this Struct Value { void *val ; char type; } The "char type" holds
2019 Oct 21
2
How to create vector pointer type?
Hello, Say the original type is Integer i16*,&nbsp; I want to create a v16i16* type to replace it. static Type *getVectorPtr(Type *Ty) { &nbsp; &nbsp; PointerType *PointerTy = dyn_cast<PointerType&gt;(Ty); &nbsp; &nbsp; assert(PointerTy &amp;&amp; "PointerType expected"); &nbsp; &nbsp; unsigned addSpace = PointerTy-&gt;getAddressSpace();
2015 Dec 03
3
Function attributes for LibFunc and its impact on GlobalsAA
----- Original Message ----- > From: "James Molloy via llvm-dev" <llvm-dev at lists.llvm.org> > To: "Vaivaswatha Nagaraj" <vn at compilertree.com> > Cc: "LLVM Dev" <llvm-dev at lists.llvm.org> > Sent: Thursday, December 3, 2015 4:41:46 AM > Subject: Re: [llvm-dev] Function attributes for LibFunc and its impact on GlobalsAA > >
2011 Sep 22
2
[LLVMdev] Need help in converting int to double
On Thu, Sep 22, 2011 at 3:46 PM, sarath chandra <sarathcse19 at gmail.com>wrote: > Hi James, > > First i converted the void * to int* and then did FPToSI...then did SHL...( > because CreateShl only accepts integers... i pointer casted it to int64 type > first)... Below is the code snippet.... > > > lhs = mBuilder.CreateStructGEP(firstArg, 0); > lhs =
2010 Apr 12
2
[LLVMdev] Why function pointer is different from other data type?
I'm sorry that I should remove the comment. In fact my question is about the "float (i32)* (float (i32)*)*", why we use this kind of return type instead of just "float (i32)*". Thanks a lot. Hao On Mon, Apr 12, 2010 at 5:42 PM, Duncan Sands <baldrick at free.fr> wrote: > Hi Hao Shen, > >> %4 = call float (i32)* (float (i32)*)* @get_ptr(float (i32)* @a1)
2012 Aug 20
3
[LLVMdev] How to Identify if an Argument is a pointer?
Hello, I was wondering how you can identify whether or not an Argument is a pointer. The "isDereferenceablePointer" function for Values doesn't seem to be what I want (I don't care whether or not the pointer points to allocated memory or is suitably aligned). I want to be able to discern between: i32* %pArray and i32 %pArray Thanks in advance. - John
2011 Jun 06
1
[LLVMdev] Explanation
On Jun 6, 2011, at 10:05 AM, Renato Golin wrote: > On 6 June 2011 17:08, George Baah <georgebaah at gmail.com> wrote: >> if(T == Type::getInt1PtrTy(Context, AS)) ... > > You don't need to care about address spaces to check for an int32*: > > if (T->isPointerTy()) { > const Type* intT = cast<PointerType>(T)->getElementType(); > if
2011 Sep 22
0
[LLVMdev] Need help in converting int to double
Hi Sarath, It would have really helped if you had removed the commented out code and inlined the calls to your homemade helper functions before sending it... You are doing this, in LLVM IR: %0 = getelementptr %Value* %firstArg, i32 0 ; i8** %1 = load i8** %0 ; i8* %2 = bitcast i8* %1 to i64* %3 = getelementptr %Value* %secondArg, i32 0 ; i8** %4 = load i8** %3; i8* %5 = bitcast i8* %4 to i64*
2010 Apr 12
0
[LLVMdev] Why function pointer is different from other data type?
"float (i32)* (float (i32)*)*" is not a return type. According to the description of the 'call' instruction in LLVM Assembly Language Reference Manual (http://llvm.org/docs/LangRef.html#i_call) this is a signature of the pointer to function value being invoked (which includes the return type). In your case the full signature is printed because get_ptr returns a pointer to
2015 Jul 17
2
[LLVMdev] For a pointer to pointer ?How to fast get the pointee pointer?
Hi all, i am coding to analyze an IR with multi-level pointers, and i am eager to know whether there exists a way to find the pointee pointer directly, if only given an upper level pointer. For example, in the following demo, C code: int i = 10; int *p = &i; int **pp; *pp = &p; IR code: %i = alloca i32, align 4 %p = alloca i32*, align 8 %pp = alloca i32**, align 8 store
2011 Sep 22
1
[LLVMdev] Need help in converting int to double
Yeah, that's the fault...got the answer...... Thanks James for the help... Struggling with this for so many days....... On Thu, Sep 22, 2011 at 4:02 PM, James Molloy <James.Molloy at arm.com> wrote: > Hi Sarath,**** > > ** ** > > It would have really helped if you had removed the commented out code and > inlined the calls to your homemade helper functions before