Displaying 20 results from an estimated 1200 matches similar to: "[LLVMdev] Prevent instruction elimination"
2010 Oct 25
0
[LLVMdev] Prevent instruction elimination
On Oct 25, 2010, at 2:13 AM, Xinfinity wrote:
>
> Hello,
>
> Does there exist something like a "dummy" instruction that is not removed by
> the optimizers, even if it seems to be dead code?
> I want to use such instructions to carry metadata information, but they
> should have a minimal impact on the code generation and optimization.
Use of metadata will not
2010 Oct 25
2
[LLVMdev] Prevent instruction elimination
Devang Patel wrote:
>
>
> Use of metadata will not prevent optimizer from removing an instruction.
> Actually, that is the corner stone of LLVM metadata design.
>
> I am curious, what information you want to carry and until what point ?
> -
> Devang
>
>
I want to handle new pragma inserted in the C/C++ source code and to adapt
clang to transform them in
2010 Oct 25
0
[LLVMdev] Prevent instruction elimination
On 10/25/10 4:13 AM, Xinfinity wrote:
> Hello,
>
> Does there exist something like a "dummy" instruction that is not removed by
> the optimizers, even if it seems to be dead code?
> I want to use such instructions to carry metadata information, but they
> should have a minimal impact on the code generation and optimization. I used
> an add instruction:
You may want
2010 Oct 25
2
[LLVMdev] Prevent instruction elimination
Hi,
John Criswell-4 wrote:
>
>
> You may want to use LLVM Metadata features. Search for MDNode in the
> doxygen docs for some information on how to create metadata.
>
>
I use metadata information in this way:
unsigned mk = Context.getMDKindID(mdtype);
Value *V = MDString::get(Context,StringRef(str));
MDNode* n = MDNode::get(Context, &V, 1);
2010 Oct 25
0
[LLVMdev] Prevent instruction elimination
On Oct 25, 2010, at 9:45 AM, Xinfinity wrote:
> Devang Patel wrote:
>>
>>
>> Use of metadata will not prevent optimizer from removing an instruction.
>> Actually, that is the corner stone of LLVM metadata design.
>>
>> I am curious, what information you want to carry and until what point ?
>> -
>> Devang
>>
>>
>
> I want
2010 Oct 25
2
[LLVMdev] Prevent instruction elimination
Devang Patel wrote:
>
>
> What are you going to do if "optimized LLVM code" is hoisted above or
> sinked below LLVM_dummy_inst by the optimizer ? It seems you are looking
> for a way communicate some info for a block of instructions. If that is
> the case then one solution is to extract interesting block of instructions
> in a separate function and make sure that
2010 Oct 25
0
[LLVMdev] Prevent instruction elimination
On Oct 25, 2010, at 12:09 PM, Xinfinity wrote:
>
>
> Devang Patel wrote:
>>
>>
>> What are you going to do if "optimized LLVM code" is hoisted above or
>> sinked below LLVM_dummy_inst by the optimizer ? It seems you are looking
>> for a way communicate some info for a block of instructions. If that is
>> the case then one solution is to
2011 Mar 01
3
[LLVMdev] metadata to inform the optimizers that some code should stay unchanged
Hello LLVM,
I am working on some passes that perform code transformations. Since I am
interested in performance, I apply the O3 passes, right after my pass.
However, the optimization passes modify the code inserted by my pass in an
undesirable way. As far I know, there is no way to prevent the optimizers
from optimizing some regions of code. So what I intend to do is to attach
metadata to the
2010 Oct 13
4
[LLVMdev] Values have no names when generating *.ll files in clang and llvm 2.8 ?
Hello,
I upgraded to llvm 2.8 and when I generate *.ll files from C/C++ with
clang -S -emit-llvm I obtain a *.ll file in which instructions and
basicblocks have no names.
I tried as well compiling with the -g option, but no names were given.
In the release notes it is indicated to use "--show-annotations" to print
the number of uses. Is there something similar for assigning names to
2010 Mar 05
3
[LLVMdev] How to .. jump from inline asm to a BasicBlock?
Hello,
I have a problem trying to create an inline asm that checks one condition
and based on the result of the condition it should jump to one BasicBlock or
to another. My question is: is this possible in LLVM, from the inline asm to
jump out, to the LLVM code, and if it is, how can I pass the label to which
the code should jump.
I tried passing the address of the BasicBlocks, using
2010 Oct 26
2
[LLVMdev] Prevent instruction elimination
Hello,
Devang Patel wrote:
>
>
> On Oct 25, 2010, at 12:09 PM, Xinfinity wrote:
>
>> #pragma my_pragma{
>> code
>> }
>
>> I use a map
>> (source_location, pragma) and I insert the dummy instruction when this
>> location is reached in the code generator. It seems difficult to attach
>> the
>> metadata to the first and the last
2010 Jun 24
2
[LLVMdev] How to prevent an instruction to be executed more than once?
Hi LLVM-devs,
I am looking for a way to prevent an instruction to be executed more than
once, or duplicated .. I know that by default everything can be duplicated,
but is there a work-around?
The structure of the code is
BB1 BB2
| |
| |
| |
|----------|
|
v
BB3
where the first instruction in BB3 is inserting an inline assembly
2011 Mar 04
0
[LLVMdev] metadata to inform the optimizers that some code should stay unchanged
Xinfinity wrote:
>
>
> Hello LLVM,
>
> I am working on some passes that perform code transformations. Since I am
> interested in performance, I apply the O3 passes, right after my pass.
> However, the optimization passes modify the code inserted by my pass in an
> undesirable way. As far I know, there is no way to prevent the optimizers
> from optimizing some regions of
2010 Jun 24
2
[LLVMdev] How to prevent an instruction to be executed more than once?
I need to mark the beginning of some regions of code, that I want to patch at
runtime.
In this case, I want to mark the beginning of BB4 and then to patch the
jumps, because I want to temporarily change the flow at runtime and then to
restore the previous version.
In order to patch, I need to know the exact structure of the generated code.
So, I might have a BasicBlock like:
BB4:
call void asm
2010 Oct 12
1
[LLVMdev] Specify dominator for BasicBlock to avoid "Instruction does not dominate all uses!"
Hi, I tried adding the PHI nodes in BB_unique, and it works for the simple
case described here, but in case the nodes were declared in some
predecessors of ExitBB1 and used in ExitBB1_redirect and its successors, it
won't work, unless I create entries for all of them in BB_unique.
B1 (declares PHI_1) B3
| |
B2
2010 Oct 11
3
[LLVMdev] Specify dominator for BasicBlock to avoid "Instruction does not dominate all uses!"
Hi,
I am working on a pass aimed to unify multiple exits of a loop into a unique
basic block. The approach is straight forward:
I create a unique BasicBlock BB_unique that has as predecessors all the exit
blocks of the loop, it contains a phi instruction and a switch to redirect
the flow correctly. Additionally, for each initial exit block I create an
associated block that will jump to the
2010 Oct 25
0
[LLVMdev] Prevent instruction elimination
On 10/25/10 9:49 AM, Xinfinity wrote:
> Hi,
>
>
> John Criswell-4 wrote:
>>
>> You may want to use LLVM Metadata features. Search for MDNode in the
>> doxygen docs for some information on how to create metadata.
>>
>>
> I use metadata information in this way:
> unsigned mk = Context.getMDKindID(mdtype);
> Value *V =
2010 Oct 25
1
[LLVMdev] Prevent instruction elimination
Hi Alexandra,
> The empty inline asm crossed my mind as well, but LLVM handles inline
> assemblies as calls. This would lead to a dependence if it is inside of a
> loop, right? And this means a considerable impact on the optimizers.
> Is it possible to avoid it?
if a statement has no side-effects then the optimizers will remove it.
Thus you are obliged to have a statement with
2010 Oct 26
0
[LLVMdev] Prevent instruction elimination
On Oct 26, 2010, at 9:23 AM, Xinfinity wrote:
>
> Hello,
>
>
> Devang Patel wrote:
>>
>>
>> On Oct 25, 2010, at 12:09 PM, Xinfinity wrote:
>>
>>> #pragma my_pragma{
>>> code
>>> }
>>
>>> I use a map
>>> (source_location, pragma) and I insert the dummy instruction when this
>>> location is
2010 May 10
2
[LLVMdev] Separate loop condition and loop body
Hi,
Is it possible to get the list of BasicBlocks building the condition of a
loop and the list of BasicBlocks that form the body? My first approach was
to iterate over the list of all Basicblocks of a loop and separate the
header as the condition and the remaining as the body of the loop. However,
this is not correct for instance in the case of a while loop in the form:
while( A & B) do
{