Displaying 20 results from an estimated 6000 matches similar to: "[LLVMdev] get ref to parent instruction"
2013 Jan 08
0
[LLVMdev] get ref to parent instruction
On Tue, Jan 8, 2013 at 3:06 PM, Eduardo <erocha.ssa at gmail.com> wrote:
> Hi all,
>
> How can I get a reference to an instruction if I have a reference to
> an operand? For example, let suppose I have a reference to the
> ConstantExpr "getelementptr inbounds" in the following instruction:
>
> %4 = getelementptr i32* getelementptr inbounds ([8 x i32]*
>
2013 Jan 08
0
[LLVMdev] get ref to parent instruction
Eduardo <erocha.ssa at gmail.com> writes:
> How can I get a reference to an instruction if I have a reference to
> an operand? For example, let suppose I have a reference to the
> ConstantExpr "getelementptr inbounds" in the following instruction:
>
> %4 = getelementptr i32* getelementptr inbounds ([8 x i32]*
> @__mem_grid_MOD_nnyp, i32 0, i32 0), i32 %3
>
2013 Jan 09
1
[LLVMdev] get ref to parent instruction
Hi Oscar:
In instructions like the one I showed can I expect that Value::use_begin
and Value::use_end will return only the getelementptr or there is a chance
I will get other users of that constant?
Thanks a lot,
Eduardo
On Jan 8, 2013 9:39 PM, "Óscar Fuentes" <ofv at wanadoo.es> wrote:
> Eduardo <erocha.ssa at gmail.com> writes:
>
> > How can I get a reference
2007 Jul 12
2
[LLVMdev] BasicCallGraph patch
The current BasicCallGraph will miss call sites like this:
%tmp86 = call i8* (...)* bitcast (i8* ()* @find_ispell to i8* (...)*)( )
; <i8*> [#uses=1]
Here the direct user of @find_ispell is a ConstantExpr.
I added several lines of code to address this case.
Below is the output of command: svn diff lib/Analysis/IPA/CallGraph.cpp
Attached is LLVM asm files with such function calls.
2013 Aug 02
1
[LLVMdev] replacing GetElementPtrConstantExpr with GetElementPtrInst ... sometimes
Hi
During a pass, the XCore target lowers thread local global variables by turning them into global variable arrays indexed by the (max 8) thread ID.
(see XCoreLowerThreadLocal.cpp)
This works fine for instructions e.g. GetElementPtrInst
But can't be done for constants e.g. GetElementPtrConstantExpr
Thus I would like to replace GetElementPtrConstantExpr with GetElementPtrInst when it is
2007 Jul 17
0
[LLVMdev] BasicCallGraph patch
On Thu, 12 Jul 2007, Zhongxing Xu wrote:
> The current BasicCallGraph will miss call sites like this:
> %tmp86 = call i8* (...)* bitcast (i8* ()* @find_ispell to i8* (...)*)( )
> ; <i8*> [#uses=1]
>
> Here the direct user of @find_ispell is a ConstantExpr.
> I added several lines of code to address this case.
> Below is the output of command: svn diff
2007 Jul 17
2
[LLVMdev] BasicCallGraph patch
I am doing inter-procedural static analysis, so I need to do DFS of call
graph. llvm-gcc sometimes generates this kind of call instruction, which
cause the call graph to be incomplete.
But thanks for your information, instcombine really solves the problem.
On 7/17/07, Chris Lattner <sabre at nondot.org> wrote:
>
> On Thu, 12 Jul 2007, Zhongxing Xu wrote:
> > The current
2010 Jan 25
3
[LLVMdev] Deterministic iteration over llvm iterators
Forgot cc, the entire group.
How can deterministically iterate over the uses of a variable. i.e. the uses
should be any particular order that doesn't change from execution to
execution of the opt tool.
To make myself more clearer, here is a snippet of code that has Values
reordered each time I analyze a particular piece of code(which doesn't
change) with the LLVM opt tool and my LLVM
2014 Aug 09
3
[LLVMdev] difference between replaceAllUsesWith and replaceUsesOfWith?
On Sat, Aug 9, 2014 at 6:06 AM, Tim Northover <t.p.northover at gmail.com>
wrote:
> Hi Rob,
>
> On 9 August 2014 02:03, Rob Jansen <jansen at cs.umn.edu> wrote:
> > Why is the first for loop not equivalent to the second?
>
> In the second loop, "*ui" is an llvm::Use object. It's owned by a
> User, but isn't a subclass of one. To match the
2009 Apr 14
3
[LLVMdev] InstVisitor Example
On Apr 14, 2009, at 1:49 PM, Luke Dalessandro wrote:
>
> On Apr 14, 2009, at 12:48 PM, Brice Lin wrote:
>
>> I just read the LLVM Programmer's Manual, which mentions (but
>> specifically does not include any details of) the InstVisitor
>> template. Could someone please provide an example of how to use this
>> template to find (as an example) all CallSites for
2012 Dec 02
3
[LLVMdev] GetElementPtrInst question
Hi all,
How can I create an llvm::GetElementPtrInst in which the pointer and
the index are in registers previously loaded with llvm::LoadInst ? I
mean, the generated instruction will be like this:
%1 = getelementptr i8* %myreg1, i32 %myreg2
here, %myreg1 and %myreg2 are previously created by load instructions
(llvm::LoadInst).
Please, let me know if there is an example of something similar.
2013 Apr 07
1
[LLVMdev] How to get the Instruction where one function use the global variable.
Hi, all
I try to get the Instructions where one function use the global variable.
for (llvm::Module::global_iterator gvar_iter = M.global_begin(); gvar_iter != M.global_end(); gvar_iter++)
{
llvm::GlobalVariable *gvar = &*gvar_iter;
llvm::errs() << "const global var: " << gvar->getName() << "\n";
for (
2012 Dec 02
1
[LLVMdev] GetElementPtrInst question
Hi James,
Thanks for your quick reply.
> I assume because you asked this question, something went wrong when using the above method. What was it? :)
No, I am not using this method. I was trying to create a
llvm::GetElementPtrInst . I didn't create IRBuilder. I am writing a
ModulePass that insert new instruction to an existing Module.
Besides, how can you get a reference to myreg1 ?
2008 Dec 05
1
[LLVMdev] replacing a global variable by a constant
Thanks a lot for your help Matthijs! :)
basically this does the job quite nicely I think:
for (llvm::GlobalVariable::use_iterator U = gv->use_begin(); U !=
gv->use_end(); ++U) {
llvm::Instruction *I = llvm::cast<llvm::Instruction>(U);
I->replaceAllUsesWith(constPtr);
I->eraseFromParent();
}
Cheers,
Ralf
Matthijs Kooijman wrote:
> Hi Ralf,
>
>
>> I
2009 Apr 14
2
[LLVMdev] InstVisitor Example
I just read the LLVM Programmer's Manual, which mentions (but
specifically does not include any details of) the InstVisitor
template. Could someone please provide an example of how to use this
template to find (as an example) all CallSites for the function
strcpy?
Thanks,
Brice Lin
2008 Sep 22
0
[LLVMdev] Overzealous PromoteCastOfAllocation
On Sep 13, 2008, at 1:07 PM, Matthijs Kooijman wrote:
> Hi Dan,
>
>> Changing PromoteCastOfAllocation to not replace aggregate allocas
>> with
>> non-aggregate allocas if they have GEP users sounds reasonable to me.
> This sounds reasonable indeed, but still a bit arbitrary. Haven't
> figured out
> anything better yet, though.
>
>> Finding the
2008 Jul 18
0
[LLVMdev] Casting between address spaces and address space semantics
Hi Eli, Mon Ping,
> In ISO/IEC WG14 n1169 on the C extensions to support embedded
> processors, any two address spaces must be disjoint, must be
> equivalent, or must be nested.
Ah, that standard is a lot clearer on this subject than the DSP-C one I read
was.
> As Eli indicated, the actual relationship is platform specific depending on
> what makes the most sense for
2012 Dec 29
2
[LLVMdev] GetElementPtrConstantExpr question
Hi all,
I just come across an IR instruction like this:
%0 = getelementptr i32* getelementptr inbounds ([42 x i32]* @aaa,
i32 0, i32 0), i32 %2
What does the part "i32* getelementptr inbounds ([42 x i32]* @aaa, i32
0, i32 0)" mean? As far as I could understand this is a
GetElementPtrConstantExpr, isn't it?
My question is: how can I instantiate a class that represents that
2008 Jul 21
2
[LLVMdev] Casting between address spaces and address space semantics
Hi all,
> If I read the standard correctly, the properties of these address spaces can
> be fully captured by defining the relationship between every pair of address
> spaces (disjoint, identical, subset/superset).
>
> I think it would make sense to make these relationships backend/platform
> specific, but for clang and the optimization passes to properly work with
> address
2009 Apr 03
6
[LLVMdev] Patch: MSIL backend global pointers initialization
Anton Korobeynikov wrote:
> Hi, Artur
>
>
>> I'm working on that backend now, so probably I'll send some more patches
>> soon. I'd be grateful if you could give me some suggestions how to add
>> some test for that backend to the test-suite. On Linux the output code
>> could be run on Mono and compared with outputs for other backends but
>>