Displaying 20 results from an estimated 10000 matches similar to: "[LLVMdev] LLVM SSA"
2009 Sep 26
0
[LLVMdev] LLVM SSA
ivtm <martinaide1 at yahoo.com> writes:
> I am wondering if there are options that can be given to LLVM can be used to
> generate code that is not in SSA, but in plain 3-address form ? (for
> example, if there is an existing pass that does the register allocation and
> dead variable elimination)
>
> For example, if I have:
>
> int x = 0;
>
> void main()
> {
2009 Sep 26
3
[LLVMdev] LLVM SSA
I am familiar with the LLVM IR a little bit and I am parsing much more
complex examples. I just gave this example, to show that I would like to
have only 1 variable, not 2, the way SSA would generate it.
I am actually using LLVM purely as a front end to translate to .bc files and
then I have my own parser from there.
At any rate, is there an option to the llvm-gcc --emit-llvm to tell it to
2009 Sep 28
4
[LLVMdev] Printing Function Arguments
ivtm wrote:
> Hey Oscar,
>
> I want to extract information from the instruction.
>
> Think writing a simple interpreter.
>
> I already have the CallInst instance (described above in the message).
>
> Via ci->getOperand(1) say I can get the 'i32 8' parameter and I can get the
> 'i32' and '8' separately as Nick described.
>
> But I
2009 Sep 26
1
[LLVMdev] LLVM SSA
LLVM IR is always in SSA form. If you *really* don't want it to be,
use allocas for everything and then don't run the mem2reg optimization
pass. This will represent all of your variables as stack locations
instead of registers, and it will not be SSA.
Reid
On Sat, Sep 26, 2009 at 3:55 PM, ivtm <martinaide1 at yahoo.com> wrote:
>
> I tried the -O0 option and I am still
2009 Sep 26
1
[LLVMdev] LLVM SSA
I tried the -O0 option and I am still getting output in SSA form:
I do:
llvm-gcc -O0 -emit-llvm -c x.c -o x.bc,
and then:
llvm-dis x.bc
Anton Korobeynikov-2 wrote:
>
>> At any rate, is there an option to the llvm-gcc --emit-llvm to tell it to
>> produce .bc files that are at least space optimized (or even better, not
>> in
>> SSA form) ?
> Yes, -O0
>
>
2009 Sep 28
0
[LLVMdev] Printing Function Arguments
Hi Nick,
I parsed your message again carefully and did some experiments.
I guess the:
for (User::op_iterator i = I->op_begin(), e = I->op_end(); i != e; ++i)
{
}
iterates over the operands of the instruction "I", which are as you said,
*other* instructions.
But if I want to get other information about the instruction, say the type
of the operands,
then I still need to figure
2009 Sep 28
3
[LLVMdev] Printing Function Arguments
ivtm <martinaide1 at yahoo.com> writes:
> Another question, I need to get the "%0" below in the:
>
> %0 = tail call i32 (...)* @__FFF (i32 8) nounwind; <i32> [#uses=1]
>
> that is, the return register.
What information do you want, exactly?
In your example, %0 is the CallInst. So if you have
CallInst *ci = CallInst::Create(...
then use `ci' whenever
2009 Sep 28
0
[LLVMdev] Printing Function Arguments
Hey Oscar,
I want to extract information from the instruction.
Think writing a simple interpreter.
I already have the CallInst instance (described above in the message).
Via ci->getOperand(1) say I can get the 'i32 8' parameter and I can get the
'i32' and '8' separately as Nick described.
But I need to extract the %0 from the CallInst instance somehow. I am not
sure
2009 Sep 26
1
[LLVMdev] LLVM SSA
I tried using the mem2reg pass with opt,
e.g. opt -reg2mem x.bc > x2.bc
where x.bc was produced with:
llvm-gcc -O2 -emit-llvm -c x.c -o x.bc
This did not reduce the # of variables in x2.bc
I use -O2 because it produces the least # of instructions and hence the
least # of new SSA virtual registers.
Do you have a set of options to give to llvm-gcc or opt in mind ?
My goal is to take a .c
2009 Sep 28
0
[LLVMdev] Printing Function Arguments
Another question, I need to get the "%0" below in the:
%0 = tail call i32 (...)* @__FFF (i32 8) nounwind; <i32> [#uses=1]
that is, the return register.
I am wondering in general, where should I look in the llvm codebase for
parsing instructions ?
I am looking at existing passes and also the header files like Function.h,
etc to see what methods they have, but it takes a while
2009 Sep 28
3
[LLVMdev] Printing Function Arguments
Hi Nick,
Thanks, that seemed to work.
Nick Lewycky wrote:
>
> ivtm wrote:
>> I am processing the LLVM instructions and right now I am at the 'call'
>> instruction.
>> For now I just want to print the argument type.
>>
>> For example in the following:
>>
>> %0 = tail call i32 (...)* @__FFF (i32 8) nounwind; <i32> [#uses=1]
2009 Sep 28
0
[LLVMdev] Printing Function Arguments
Hi Nick,
Perhaps I am confused. What is the best way to extract information from
instructions ?
Is it via the, say:
for (User::op_iterator i = I->op_begin(), e = I->op_end(); i != e; ++i)
....
I am not sure what happens next, e.g. to the variable 'i', you should know
what part of the instruction this is and cast it to the necessary type.
For example, I am parsing the
2007 Nov 29
0
[LLVMdev] [Caml-list] Ocaml(opt) & llvm
On Nov 28, 2007, at 10:16 PM, Gordon Henriksen wrote:
>> It only works if values are not held in registers across throws
>> though, which is kinda lame ...
>
>
> Though I'm primarily interested in this model only from an
> interoperability perspective, reloading the register file for a throw
> seems a comparatively small price to pay compared to, say,
>
2016 Jun 27
3
Why not do machine instruction scheduling in SSA form?
Hi LLVM community,
Currently LLVM backend do pre-RA machine instruction scheduling in non-SSA form, I doubt why not do machine scheduling in SSA machine instruction form? Now LLVM’s machine scheduling uses a list-scheduling algorithm, but if we wang to support more complex scheduling algorithms, for example, modulo scheduling for loops, it seems more easy to accomplish this in SSA form as SSA is
2016 Jun 27
0
Why not do machine instruction scheduling in SSA form?
A motivation for scheduling later is that the program representation is closer to the final instruction stream which makes the machine simulation more accurate. If you schedule too early you do not see the instructions produced by phi elimination and the two address fixup pass.
LiveIntervals should work on MachineSSA form. If it doesn't you should file a bugzilla ticket with more details.
-
2008 Jul 17
0
[LLVMdev] SSA or not SSA?
On Thu, Jul 17, 2008 at 6:34 AM, Matthieu Moy <Matthieu.Moy at imag.fr> wrote:
> Patrick Meredith <pmeredit at uiuc.edu> writes:
>
>> Memory is what the i32* points too. The i32* itself is in a
>> register. You can store to it as many times as you want, but you
>> can't change the address, because that would violate SSA.
>
> Thanks,
>
> For the
2008 Jul 17
2
[LLVMdev] SSA or not SSA?
Patrick Meredith <pmeredit at uiuc.edu> writes:
> Memory is what the i32* points too. The i32* itself is in a
> register. You can store to it as many times as you want, but you
> can't change the address, because that would violate SSA.
Thanks,
For the record, I finally understood by making a few experiments:
This is (obviously) valid:
define i32 @main() {
2013 May 26
2
[LLVMdev] How to use WhileStmt to implement while loop in LLVM
Dear All,
I have a question
How could I use WhileStmt class in Stmt.h
http://clang.llvm.org/doxygen/Stmt_8h_source.html
to implement while loop like while(i==1){} that is required to be inserted
For example, Convert x++; y++; to x++; while(i=1){} y++;
from the class's constructor:
WhileStmt(ASTContext &C, VarDecl *Var, Expr *cond, Stmt
*body,SourceLocation WL);//I know C -->
2008 Jul 07
2
[LLVMdev] SSA or not SSA?
Hi,
Silly question from an LLVM newbie: the LLVM LRM say that the bytecode
is "is an SSA based representation". Indeed, my experience with
llvm-gcc is that the generated code is not necessarily SSA, while
the one given by "llvm-gcc -O1" is.
Is this assumption correct?
Is there a non-SSA to SSA translator available?
Thanks,
--
Matthieu
2013 May 26
0
[LLVMdev] How to use WhileStmt to implement while loop in LLVM
Rasha Omar wrote:
> Dear All,
>
> I have a question
>
> How could I use |WhileStmt class| in Stmt.h
>
> http://clang.llvm.org/doxygen/Stmt_8h_source.html
>
> to implement |while loop| like |while(i==1){}| that is required to be
> inserted
>
> For example, Convert x++; y++; to x++; while(i=1){} y++;
>
> from the class's constructor:
>
>