Displaying 20 results from an estimated 1000 matches similar to: "[LLVMdev] How to delete a instruction?"
2010 Apr 20
0
[LLVMdev] How to delete a instruction?
lucefe wrote:
> Hi,
>
> when I delete some instruction, I got some error prompt message.
Deleting instructions can be a little tricky. The problem is that you
can't delete an instruction until there are no other instructions that
are using it. There are two things that you can do:
1) Order your deletions so that the instructions at the end of def-use
chains are deleted first;
2008 Dec 09
1
[LLVMdev] scalar-evolution + indvars fail to get the loop trip count?
Hi,
Seems pass scalar-evolution+indvars fail to get the loop trip count of the
following case:
int foo(int x, int y, int lam[256], int alp[256]) {
int i;
int z = y;
for (i = 255; i >= 0; i--) {
z += x;
lam[i] = alp[i];
}
return z;
}
The final optimized ll code is :
define i32 @foo(i32 %x, i32 %y, i32* %lam, i32* %alp) nounwind {
entry:
br label %bb
bb:
2010 Sep 10
1
[LLVMdev] Missing Optimization Opportunities
Hi,
I'm using LLVM 2.7 right now, and I found "opt -std-compile-opts" has
missed some opportunities for optimization:
define void @spa.main() readonly {
entry:
%tmp = load i32* @dst-ip ; <i32> [#uses=3]
%tmp1 = and i32 %tmp, -16777216 ; <i32> [#uses=1]
%tmp2 = icmp eq i32 %tmp1, 167772160 ; <i1> [#uses=2]
2008 Dec 07
1
[LLVMdev] How to extract loop body into a new function?
False Alarm!!
Still don't know how to do it!
I am trying to write a transformation pass to extract a loop body into a function.
For example:
The Loop in question is:
for (i2 = 0; i2 < LOOP_SIZE; i2++) {
A[B[i2]] = 2 * B[i2];
}
The IR for which is:
bb13: ; preds = %bb13, %bb
%i2.0.reg2mem.0 = phi i32 [ 0, %bb ], [ %indvar.next62, %bb13 ] ; <i32>
2013 Oct 27
2
[LLVMdev] Missed optimization opportunity with piecewise load shift-or'd together?
The following piece of IR is a fixed point for opt -std-compile-opts/-O3:
---
target datalayout =
"e-p:64:64:64-S128-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f16:16:16-f32:32:32-f64:64:64-f128:128:128-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
target triple = "x86_64-unknown-linux-gnu"
; Function Attrs: nounwind readonly
define i32 @get32Bits(i8*
2007 Jun 12
3
[LLVMdev] ARM backend problem ?
Hello,
I want to compile a LLVM file into an executable running on ARM platform.
I use LLVM 2.0 with the following command lines:
llvm-as -f -o test.bc test.ll
llc -march=arm -mcpu=arm1136j-s -mattr=+v6 -f -o test.s test.bc
arm-linux-gnu-as -mcpu=arm1136j-s test.s
With the last command, I obtain the following error:
rd and rm should be different in mul
The bad instruction is
2007 Jun 12
0
[LLVMdev] ARM backend problem ?
Hi Mikael,
You are obtaining warning, not an error, right? The most arm cores,
including arm1136, can execute mul with rd = rm. So, you can ignore
this warning.
Lauro
2007/6/12, Peltier, Mikael <m-peltier at ti.com>:
>
>
>
>
> Hello,
>
>
>
> I want to compile a LLVM file into an executable running on ARM platform.
>
> I use LLVM 2.0 with the following
2008 Jan 12
1
[LLVMdev] Labels
I'm attempting to modify a parser generator to emit LLVM code instead of C.
So far the experience has been trivial, but I am now running into an error
regarding labels that I can't seem to solve.
Situation 1: A label is used immediately after a void function call (l6 in
this case):
<snip>
%tmp26 = load i32* @yybegin, align 4
%tmp27 = load i32* @yyend, align 4
call void
2010 Nov 23
1
[LLVMdev] Unrolling loops into constant-time expressions
Hello,
I've come across another example:
I'm compiling with
clang -S -emit-llvm -std=gnu99 -O3
clang version 2.9 (trunk 118238)
Target: x86_64-unknown-linux-gnu
Thread model: posix
I take the code:
int loops(int x) {
int ret = 0;
for(int i = 0; i < x; i++) {
for(int j = 0; j < x; j++) {
ret += 1;
}
}
return ret;
}
and the
2009 Jan 06
2
[LLVMdev] LLVM Optmizer
The following C code :
#include <stdio.h>
#include <stdlib.h>
int TESTE2( int parami , int paraml ,double paramd )
{
int varx=0,vary;
int nI =0;
//varx= parami;
if( parami > 0 )
{
varx = parami;
vary = varx + 1;
}
else
{
varx = vary + 1;
vary = paraml;
}
varx = varx + parami + paraml;
for( nI = 1 ; nI <= paraml; nI++)
{
varx =
2008 Dec 07
0
[LLVMdev] How to extract loop body into a new function?
Sorry!
It worked with ExtractBasicBlock()
----- Original Message -----
From: "Mrunal J Shah" <mrunal.shah at gatech.edu>
To: "llvmdev" <llvmdev at cs.uiuc.edu>
Sent: Saturday, December 6, 2008 8:30:33 PM GMT -05:00 US/Canada Eastern
Subject: [LLVMdev] How to extract loop body into a new function?
Hi All,
I am having trouble extracting loop body into a new
2008 Dec 07
2
[LLVMdev] How to extract loop body into a new function?
Hi All,
I am having trouble extracting loop body into a new function. The ExtractLoop() or ExtractBasicBlock() extracts the entire loop along with the header into a new function. All I want is to extract the body of the loop into a new function(without the header).
Is this possible?
Thanks,
Mrunal
2013 Oct 28
0
[LLVMdev] Missed optimization opportunity with piecewise load shift-or'd together?
On Oct 27, 2013 2:16 PM, "David Nadlinger" <code at klickverbot.at> wrote:
>
> The following piece of IR is a fixed point for opt -std-compile-opts/-O3:
>
> ---
> target datalayout =
>
"e-p:64:64:64-S128-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f16:16:16-f32:32:32-f64:64:64-f128:128:128-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
2013 Nov 15
0
[LLVMdev] dominator, post-dominator and memory leak
Try breaking the critical edges (-break-crit-edges).
This way, a new block will be created between BB13 and BB11 (call this
BB11.break) and BB15 and BB12 (call this BB12.break).
The predecessors of the dominance frontier will, thus, be BB11.break,
BB12.break, and BB14.
When we enter through a block with a call to malloc(), we will end up in
one of the blocks in the dominance frontier (kind of).
2011 Aug 19
1
[LLVMdev] Break operands into multiple instructions
Hi All,
I am creating an instrumentation pass using LLVM libraries. I am using clang++ (version 2.9) to compile cpp code into LLVM bit code. When I generate the llvm bit code using clang++ using -O3, I get many instances of instructions that look like the following.
br i1 icmp ne (i8* bitcast (i32 (i32)* @pthread_cancel to i8*), i8* null), label %bb23, label %bb25
Here three LLVM instructions
2013 Nov 15
2
[LLVMdev] dominator, post-dominator and memory leak
Hi Henrique,
I have tried using -mergereturn and inserting a free into the predecessors
of dominance frontier of malloc block and it caused double free. It is
possible for multiple free's to be inserted on the path from malloc to an
exit. For example, in the following CFG:
BB10 (malloc)
/ \
BB11 BB12
... / \ / \
2010 Nov 07
0
[LLVMdev] Hoisting elements of array argument into registers
David Peixotto <dmp <at> rice.edu> writes:
> I am seeing the wf loop get optimized just fine with llvm 2.8 (and almost
as good with head).
I rechecked this and am I actually seeing the same results as you. I think I
must have made a stupid mistake in my tests before - sorry for the noise.
However, I found that we have a phase ordering problem which is preventing us
getting as much
2013 Nov 13
0
[LLVMdev] dominator, post-dominator and memory leak
>
> It seems that placing the calls to free at the predecessors of dominance
> frontier is inadequate. It is possible that there are exit blocks that are
> dominated by BB12 (calls to malloc). I guess we can also insert calls to
> free at these exit blocks too.
That crossed my mind a few minutes later. : )
If you're interested, PRE.cpp existed last at r25315. It calculates the
2013 Nov 13
3
[LLVMdev] dominator, post-dominator and memory leak
Hi Henrique,
Thanks for the quick reply!
On Tue, Nov 12, 2013 at 9:13 PM, Henrique Santos <
henrique.nazare.santos at gmail.com> wrote:
> PRE normally uses a latest placement algorithm to do something of the sort.
> I don't know about GVN/PRE, but older version of PRE might have it.
> Just placing the calls to free at the predecessors (dominated by BB12) of
> the dominance
2013 Nov 13
0
[LLVMdev] dominator, post-dominator and memory leak
PRE normally uses a latest placement algorithm to do something of the sort.
I don't know about GVN/PRE, but older version of PRE might have it.
Just placing the calls to free at the predecessors (dominated by BB12) of
the dominance frontier of BB12 seems to work, however. Is there anything
wrong with this?
H.
On Tue, Nov 12, 2013 at 11:30 PM, Bin Tzeng <bintzeng at gmail.com> wrote: