Displaying 20 results from an estimated 1000 matches similar to: "[LLVMdev] Accessing arguments in a caller"
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 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 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 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 Jul 07
0
[LLVMdev] Missed optimization with indirectbr terminator
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 bug with your test case.
> In the source it says "If the predecessor is an indirect goto, we
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 22
2
[LLVMdev] Accessing arguments in a caller
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 x;
int y;
int z;
...
};
...
struct StackObjects stack;
then pass the address of stack to your
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 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 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 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 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 Jul 29
0
[LLVMdev] Is using lots of in-register values in IR bad?
Hi Erkki,
> I want to experiment with avoiding mutable state as far as I can. At the moment
> there are no mutable variables -- only immutable value types (numerics, bool,
> vectors, tuples) and I've been doing everything in LLVM registers. The compiler
> doesn't generate a single alloca, load or store at the moment.
>
> I wonder if it was maybe a bad idea to do it this
2011 Aug 31
2
[LLVMdev] StructTypes in module
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...
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110831/17715c85/attachment.html>
-------------- next part --------------
A non-text attachment was
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 Aug 31
0
[LLVMdev] StructTypes in module
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 efficient operation.
-Chris
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 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 Aug 21
0
[LLVMdev] Accessing arguments in a caller
Variadic templates themselves don't avoid the copy, but combined with
perfect forwarding you should be doing well (see, for example,
make_shared)
From: Jordy Rose
Sent: 8/21/2011 10:34 AM
To: Carlo Alberto Ferraris
Cc: llvmdev at cs.uiuc.edu
Subject: Re: [LLVMdev] Accessing arguments in a caller
What I can think of:
1. Anonymous struct, to avoid a copy.
2. Use stdarg.h...dangerous but
2011 Jul 28
4
[LLVMdev] Is using lots of in-register values in IR bad?
Hi,
I'm a newbie when it comes to compilers (and even close-to-machine coding),
but recently started working on my own language and am using LLVM as the
mid/backend. Currently I'm generating .ll files from a front-end written in
Scala. The language is not really serious, just a way to learn more about
compilers (and LLVM) and maybe serve as a base for further experiments. It's