Displaying 20 results from an estimated 12000 matches similar to: "[LLVMdev] Extracting loop body"
2011 Jan 27
2
[LLVMdev] Update PHINode after extracting code
On 01/26/2011 07:50 PM, Vu Le wrote:
> I guess I didn't have a clear question.
>
> Suppose we have BB1 and BB2 both point to BB3.
> BB1 has variable x. BB2 also as variable x.
> BB3 will have PHINode for x with 2 value from BB1 and BB2.
> BB1 BB2
> \ /
> BB3
>
> Now if BB1 and BB2 is extracted into a function
> (using ExtractCodeRegion), they
2011 Jan 27
0
[LLVMdev] Update PHINode after extracting code
I guess I didn't have a clear question.
Suppose we have BB1 and BB2 both point to BB3.
BB1 has variable x. BB2 also as variable x.
BB3 will have PHINode for x with 2 value from BB1 and BB2.
BB1 BB2
\ /
BB3
Now if BB1 and BB2 is extracted into a function
(using ExtractCodeRegion), they will be replaced by
a basic block called codeRepl (which has a call to the extracted
2011 Jan 25
2
[LLVMdev] Update PHINode after extracting code
Hi all,
I have problem with ExtractCodeRegion (CodeExtractor.cpp).
My original program is as follows.
bb:
...
%tmp.15 = load %struct.MYSQL_ROWS** %3, align 4
...
bb1:
...
%tmp.1 = load %struct.MYSQL_ROWS** %6, align 4
...
bb4: ; preds = %bb1, %bb,
%entry
%tmp.0 = phi %struct.MYSQL_ROWS* [ null, %entry ], [ %tmp.15, %bb ], [
%tmp.1, %bb1 ]
2006 Oct 01
2
[LLVMdev] Extracting all BasicBlocks of a Function into new Function
Hi,
I need to find a way to extract all BasicBlocks of a Function (no
clones!) into a new Function that has the exact same signature, and
adding a call to the new Function in the old one. I tried out lib/
Transforms/Utils/CodeExtractor::ExtractCodeRegion(...), but this one
unfortunately checks first to see whether there are any allocas and/
or va_starts and returns a null pointer in that
2011 Jan 27
0
[LLVMdev] Update PHINode after extracting code
Hi Tobias,
If the PHI node at exit block of region R has multiple inputs from the R,
I split the exit block into 2.
The first block contains all PHI nodes whose input are all from the region.
The second is the new exit node.
All branches (outside R) to the old exit now point the new exit.
All regions whose exit is the old exit are also updated with the new exit
node.
It works like a charm.
2005 Apr 20
2
[LLVMdev] "Refactoring" Basic Blocks into a new function
On Apr 19, 2005, at 23:17, Vikram Adve wrote:
> Have you looked at ExtractCodeRegion() and its siblings in
> include/llvm/Transform/Utils/FunctionUtils.h? It seems to be what you
> need.
This is brilliant. In fact, it is nearly *exactly* what I need.
On Apr 19, 2005, at 23:59, Chris Lattner wrote:
> An Interval (and an Interval partition) is a concept with a lot of
> compiler
2010 Oct 20
0
[LLVMdev] Pass Incompatibility
On Oct 20, 2010, at 4:05 AM, Luke Dalessandro wrote:
> If I register DemoteRegisterToMemoryID first
I'd expect this to work.
> then I get this assert during code extraction.
>
> CodeExtractor.cpp:681: llvm::Function*<unnamed>::CodeExtractor::ExtractCodeRegion(const std::vector<llvm::BasicBlock*, std::allocator<llvm::BasicBlock*> >&): Assertion
2010 Oct 20
5
[LLVMdev] Pass Incompatibility
I have a transformation where I'd like to use both DominatorTree (for ExtractCodeRegion), and DemoteRegisterToMemory (i.e., reg2mem). The transformation is phased, so all occurrences of getAnalysis<DominatorTree>(Function) happen before any occurrence of getAnalysisID<FunctionPass>(&DemoteRegisterToMemoryID, Function).
If I register these two passes with DominatorTree first, I
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>
2006 Oct 02
0
[LLVMdev] Extracting all BasicBlocks of a Function into new Function
On Sun, 1 Oct 2006, Bram Adams wrote:
> One of the obstacles I face when trying to do the complement
> (creating new Function and adding call to original in it), is to find
> out how to pass the varargs argument of the new Function into the
> call to the old Function. Will passing the sbyte** passed to
> llvm.va_start do the trick?
I think this is the better way to go. If
2006 Oct 02
3
[LLVMdev] Extracting all BasicBlocks of a Function into new Function
Hi,
Op 2-okt-06, om 21:35 heeft Chris Lattner het volgende geschreven:
> I think the easiest way to do this is to do the 'complement' as you
> describe, but specially handle the varargs case. Basically you
> need to
> call va_start in the original function, and pass the valist pointer
> down.
> This shouldn't be too hard.
OK.
I've been rethinking my use
2008 Feb 01
1
[LLVMdev] Code Extractor Issue
I'm having an issue with the CodeExtractor. When I try to extract the lone basic block from the following function, I get an assertion error.
define i32 @test(i32 %x) {
%tmp = call i32 @test3( i32 %x ) ; <i32> [#uses=1]
ret i32 %tmp
}
The assertion error is:
lli: Dominators.cpp:71: void llvm::DominatorTree::splitBlock(llvm::BasicBlock*): Assertion
2010 Oct 20
0
[LLVMdev] Pass Incompatibility
On 10/20/10 6:05 AM, Luke Dalessandro wrote:
> I have a transformation where I'd like to use both DominatorTree (for ExtractCodeRegion), and DemoteRegisterToMemory (i.e., reg2mem). The transformation is phased, so all occurrences of getAnalysis<DominatorTree>(Function) happen before any occurrence of getAnalysisID<FunctionPass>(&DemoteRegisterToMemoryID, Function).
I
2005 Apr 20
0
[LLVMdev] "Refactoring" Basic Blocks into a new function
On Apr 19, 2005, at 8:39 PM, Evan Jones wrote:
> I have two very specific questions about LLVM, but first let me give
> you the general overview of what I am trying to achieve. I have some
> section of a function that I want to replace with a function call to a
> brand new function. For example, I want to take the following
> function:
>
> function foo:
> code A
>
2010 Dec 22
0
[LLVMdev] Extracting Single-entry single-exit Regions into functions
Hi,
I want to write a pass that pulls single-entry a single-exit (SESE) region
into a function.
The idea is similar to extracting a loop in LoopExtractor.cpp.
Basically, for each region that meet our criteria,
1. Find all basic blocks in that regions
2. Call llvm::ExtractCodeRegion() to replace that region by a call to the
extracted function.
3. Delete the region from the RegionPassManager queue
2012 May 02
2
[LLVMdev] Taking over work on CodeExtractor, spiffing it up, and making it nice & easy to use
Hello folks,
Just as a heads up, I chatted with Owen today about a little known bit of
LLVM: lib/Transforms/Utils/CodeExtractor.cpp
A toy project of mine has a use for this functionality, and it still seems
to mostly work, so I'm going to be spending some time doing cleanup and
general maintenance on the code to make it easier and more suitable for
consumption by actual optimization passes.
2012 May 02
1
[LLVMdev] Taking over work on CodeExtractor, spiffing it up, and making it nice & easy to use
On Wed, May 2, 2012 at 1:57 AM, Dmitry N. Mikushin <maemarcus at gmail.com>wrote:
> At KernelGen we have an out-of-tree variation of CodeExractor called
> BranchedCodeExractor [1], which instead of taking a code region into a new
> function, does it conditionally:
>
OK... as this is an out-of-tree branch of the code extraction, nothing I'm
planning should negatively impact
2012 May 02
0
[LLVMdev] Taking over work on CodeExtractor, spiffing it up, and making it nice & easy to use
Dear Chandler,
> Please let me know if you have out-of-tree users of this logic
At KernelGen we have an out-of-tree variation of CodeExractor called
BranchedCodeExractor [1], which instead of taking a code region into a new
function, does it conditionally:
ORIGINAL_CODE;
->>
if (extracted_code_function(args) != -1)
{
ORIGINAL_CODE;
}
I think many hybrid and parallelizing tools
2010 Sep 10
0
[LLVMdev] parameters sent by llvm::ExtractCodeRegion
Hello,
I use llvm::ExtractCodeRegion to extract a region of code into a new
function and everything seems to be OK. But I need to write the new function
into a separate file for further processing. Therefore, I copy in the new
file the new function together with all globals and declarations of the
module, to make them visible for my function.
The problem appears when I have some global static
2011 Mar 12
0
[LLVMdev] problems when the llvm::ExtractCodeRegion updates the Phi nodes in successors ... is there a method to eliminate phi nodes ?
Hi,
I use the llvm::ExtractCodeRegion to extract each loop into a separate function,
but I have a problem when I run this on the SPEC CPU 2006 on the 401.bzip2
benchmark. First I use clang -O3 to generate optimized llvm code and then I
extract some loops from the module built from blocksort.c source file.
The problem is that the PHI nodes contained in the successors of the codeRepl