Displaying 20 results from an estimated 3000 matches similar to: "[LLVMdev] Accessing arguments in a caller"
2011 Aug 21
2
[LLVMdev] Accessing arguments in a caller
What I can think of:
1. Anonymous struct, to avoid a copy.
2. Use stdarg.h...dangerous but accomplishes what you're looking for.
3. Split up F: giant switch statements often indicate that your function is doing several different things. (IMHO...)
4. Don't worry about it, it's probably not a bottleneck. (Or rather, profile first...)
But no, there's no standard way to do this. Even
2011 Aug 21
0
[LLVMdev] Accessing arguments in a caller
Nella citazione giovedì 18 agosto 2011 09:11:36, Carlo Alberto Ferraris
ha scritto:
> I need some advice on "forwarding" arguments to a callee. Suppose I have
> a function F that is called at the beginning of all other functions in
> the module. From F I need to access (read) the arguments passed to its
> immediate caller. Right now I do something like boxing all
2011 Aug 18
2
[LLVMdev] Accessing arguments in a caller
I need some advice on "forwarding" arguments to a callee. Suppose I have
a function F that is called at the beginning of all other functions in
the module. From F I need to access (read) the arguments passed to its
immediate caller. Right now I do something like boxing all arguments in
the caller inside a struct and passing a pointer to the struct to F,
alongside an identifier
2011 Aug 02
0
[LLVMdev] Multiple successors, single dynamic successor
Nella citazione martedì 2 agosto 2011 22:01:13, Carlo Alberto Ferraris
ha scritto:
> My question is:
> what is the best way to
> express such relationships in LLVM IR ("best" in the sense of allowing
> other optimizations to run effectively)? Bear in mind that in this
> example N=2, but it may be way bigger than that.
Just to clarify: I already figured out two ways to
2011 Jul 08
4
[LLVMdev] Missed optimization with indirectbr terminator
Nella citazione giovedì 7 luglio 2011 19:41:16, John McCall ha scritto:
> On Jul 7, 2011, at 4:33 AM, Carlo Alberto Ferraris wrote:
>> Il 07/07/2011 11:14, Cameron Zwarich ha scritto:
>>> I haven't read the code in detail, but it looks like JumpThreading at
>>> least attempts to thread across indirect branches. You can either try
>>> to fix it or file a
2011 Aug 01
1
[LLVMdev] SwitchInst::addCase with BlockAddress
Nella citazione lunedì 1 agosto 2011 08:13:12, Eli Friedman ha scritto:
> On Sun, Jul 31, 2011 at 7:36 AM, Carlo Alberto Ferraris
> <cafxx at strayorange.com> wrote:
>> I'm trying to figure out how to feed a blockaddress to a switch condition
>> AND destination (basically emulating an indirectbr via a switch; I know it's
>> not a good approach, I'm just
2011 Aug 22
0
[LLVMdev] Accessing arguments in a caller
Nella citazione lunedì 22 agosto 2011 11:53:29, Duncan Sands ha scritto:
> Hi Carlo, rather than declaring individual stack variables
> int x;
> int y;
> int z;
> and so on, which requires you to pass each one, or a pointer to each one,
> to your function, declare one stack variable of struct type that holds
> them all:
> struct StackObjects {
> int
2011 Jul 29
1
[LLVMdev] Is using lots of in-register values in IR bad?
Nella citazione venerdì 29 luglio 2011 11:24:47, Duncan Sands ha
scritto:
> In-register structs and arrays are not intended to be used for large structs and
> arrays.
Out of curiosity, why would that be the case?
--
Carlo Alberto Ferraris <cafxx at strayorange.com
<mailto:cafxx at strayorange.com>>
website/blog <http://cafxx.strayorange.com> - +39 333 7643 235
2011 Aug 02
3
[LLVMdev] Multiple successors, single dynamic successor
Nella citazione martedì 2 agosto 2011 20:02:08, Michael Ilseman ha
scritto:
> I'm assuming that you're talking about a situation where this can't be
> determined statically in the existing LLVM IR, but you know it's true
> and want to put it in (e.g. you're the one generating LLVM IR).
Correct. Or, more precisely, I'd like to investigate macro compression,
i.e.
2011 Aug 31
1
[LLVMdev] StructTypes in module
Nella citazione mercoledì 31 agosto 2011 20:35:46, Chris Lattner ha
scritto:
> On Aug 31, 2011, at 10:23 AM, Carlo Alberto Ferraris wrote:
>> Quick question: how do I get a list of StructType* defined/used in a Module? I can't seem to find an appropriate iterator in the Module class...
> Module::findUsedStructTypes. Note that this requires scanning the entire module, it is not an
2011 Jul 08
0
[LLVMdev] Missed optimization with indirectbr terminator
On Jul 7, 2011, at 10:15 PM, Carlo Alberto Ferraris wrote:
> Nella citazione giovedì 7 luglio 2011 19:41:16, John McCall ha scritto:
>> On Jul 7, 2011, at 4:33 AM, Carlo Alberto Ferraris wrote:
>>> Il 07/07/2011 11:14, Cameron Zwarich ha scritto:
>>>> I haven't read the code in detail, but it looks like JumpThreading at least attempts to thread across indirect
2011 Aug 22
0
[LLVMdev] Accessing arguments in a caller
Il 21/08/2011 19:31, Jordy Rose ha scritto:
> What I can think of:
> 1. Anonymous struct, to avoid a copy.
> 2. Use stdarg.h...dangerous but accomplishes what you're looking for.
probably it wasn't clear from my first post: I'm talking about LLVM-IR,
not C or C++.
> 3. Split up F: giant switch statements often indicate that your function is doing several different things.
2011 Aug 22
1
[LLVMdev] Accessing arguments in a caller
Hi Carlo,
> Nella citazione lunedì 22 agosto 2011 11:53:29, Duncan Sands ha scritto:
>> Hi Carlo, rather than declaring individual stack variables
>> int x;
>> int y;
>> int z;
>> and so on, which requires you to pass each one, or a pointer to each one,
>> to your function, declare one stack variable of struct type that holds
>> them all:
>>
2011 Aug 02
0
[LLVMdev] Multiple successors, single dynamic successor
I'm assuming that you're talking about a situation where this can't be
determined statically in the existing LLVM IR, but you know it's true
and want to put it in (e.g. you're the one generating LLVM IR). If
that's not the case, then see if JumpThreading will do it for you.
I'm not familiar with a way to express exactly what you want to say,
but are you opposed to just
2011 Jul 31
3
[LLVMdev] SwitchInst::addCase with BlockAddress
I'm trying to figure out how to feed a blockaddress to a switch
condition AND destination (basically emulating an indirectbr via a
switch; I know it's not a good approach, I'm just experimenting).
Suppose I have the following:
SwitchInst *s = SwitchInst::Create(...);
BasicBlock *bb = ...;
PtrToIntInst k = new PtrToIntInst(BlockAddress::get(bb), <TYPE>, "", s);
2011 Aug 02
2
[LLVMdev] Multiple successors, single dynamic successor
Suppose I have a bb with N predecessors and N successors. What is, in
your opinion, the best way to express that the bb has (dynamically) only
one successor (i.e. if coming from the i-th predecessor we will always
jump to the i-th successor)?
b.r.,
--
Carlo Alberto Ferraris <cafxx at strayorange.com
<mailto:cafxx at strayorange.com>>
website/blog
2011 Mar 31
0
[LLVMdev] LiveValues removal
LiveVariables is the optimized and tested way to get variable liveness
information (it's used by register allocation). Unfortunately it
requires a MachineFunction to work - so you'll either need to lower to
one of the built-in targets or add your own target to acquire access to
this pass.
Andrew
On 03/31/2011 12:28 PM, Carlo Alberto Ferraris wrote:
> I've read that LiveValues
2011 Jul 07
2
[LLVMdev] Missed optimization with indirectbr terminator
Il 07/07/2011 11:14, Cameron Zwarich ha scritto:
> I haven't read the code in detail, but it looks like JumpThreading at
> least attempts to thread across indirect branches. You can either try
> to fix it or file a bug with your test case.
In the source it says "If the predecessor is an indirect goto, we can't
split the edge.
2011 Aug 01
0
[LLVMdev] SwitchInst::addCase with BlockAddress
On Sun, Jul 31, 2011 at 7:36 AM, Carlo Alberto Ferraris
<cafxx at strayorange.com> wrote:
> I'm trying to figure out how to feed a blockaddress to a switch condition
> AND destination (basically emulating an indirectbr via a switch; I know it's
> not a good approach, I'm just experimenting).
> Suppose I have the following:
>
> SwitchInst *s =
2011 Jun 24
0
[LLVMdev] Missing symbols in pass stack trace
On Jun 24, 2011, at 10:49 AM, Carlo Alberto Ferraris wrote:
>
>> Try building with "make VERBOSE=1", which will show you the command-lines passed to the compiler/linker. Post the output here.
> there you go:
>> cafxx at ubuntu:~/Projects/llvm2/lib/Transforms/cgf$ make VERBOSE=1
>> llvm[0]: Compiling CGFPass.cpp for Debug+Asserts build (PIC)
>> if g++