Displaying 20 results from an estimated 1000 matches similar to: "[LLVMdev] CodeExtractor.cpp potential bug?"
2011 Jan 03
0
[LLVMdev] CodeExtractor.cpp potential bug?
On Dec 31, 2010, at 11:20 AM, Vu Le wrote:
> There might be a misuse of DominatorTree::splitBasicBlock in CodeExtractor.cpp, line 145.
> Header is splited into two (OldPred->NewBB).
>
> Line 145 updates the dominator tree by calling DT->splitBasicBlock(NewBB).
> I think it should be DT->splitBasicBlock(OldPred).
>
> When I tried to extract a code region whose
2011 Jan 24
0
[LLVMdev] CodeExtractor.cpp potential bug?
I forgot to cc llvmdev.
Here is my original message.
I'm a bit confused on DominatorTreeBase::Split() (
http://llvm.org/docs/doxygen/html/Dominators_8h_source.html#l00229)
If a basic block A splits into A->B, when I call Split(), which is NewBB? A
or B?
The semantics shows that NewBB is the newly split basic block B.
But the assertion at line 229 doesn't seem right.
00229
2010 Jan 09
2
[LLVMdev] [PATCH] Fix nondeterministic behaviour in the CodeExtractor
Hello,
The CodeExtractor contains a std::set<BasicBlock*> to keep track of the
blocks to extract. Iterators on this set are not deterministic, and so
the functions that are generated are not (the order of the
inputs/outputs can change).
The attached patch uses a SetVector instead. Ok to apply ?
Thanks,
Julien
--
Julien Lerouge
PGP Key Id: 0xB1964A62
PGP Fingerprint: 392D 4BAD DB8B CE7F
2013 Mar 02
2
[LLVMdev] Question about method CodeExtractor::severSplitPHINodes
Hi folks,
Hope this is not a silly question. But it bothers me when I am thinking
about it.
My question is:
1. In the implementation of serverSplitPHINodes(), why it only checks the
first PHI node for possible
multiple inputs from outside the region to extract. There could be more
than one PHI nodes in the header
block, and the code only checks the first one. I don't quite get it.
2008 Nov 19
2
[LLVMdev] Problem in CodeExtractor::severSplitPHINodes()
Hi,
I found a problem in CodeExtractor::severSplitPHINodes()
<CodeExtractor.cpp>.
The algorithm first separates the header block into two, one containing only
PHI nodes and the other containing the remaining non-PHI nodes. The variable
NewBB holds the pointer to the latter half block. Later, it tries to update
DT information.
if (DT)
DT->splitBlock(NewBB);
In splitBlock, it checks
2008 Nov 20
0
[LLVMdev] Problem in CodeExtractor::severSplitPHINodes()
On Nov 19, 2008, at 7:41 AM, Jack Tzu-Han Hung wrote:
> Hi,
>
> I found a problem in CodeExtractor::severSplitPHINodes()
> <CodeExtractor.cpp>.
>
> The algorithm first separates the header block into two, one
> containing only PHI nodes and the other containing the remaining non-
> PHI nodes. The variable NewBB holds the pointer to the latter half
> block.
2008 Nov 20
1
[LLVMdev] Problem in CodeExtractor::severSplitPHINodes()
Hi Devang,
Thanks for your reply.
But if you look at the comment of BasicBlock::splitBasicBlock(), it says
that "...an unconditional branch is added to the new BB, and the rest of the
instructions in the BB are moved to the newBB, including the old
terminator."
So, the terminator of the newBB is exactly the same as the terminator of the
oldBB. IF the oldBB has multiple successors,
2010 Jan 09
0
[LLVMdev] [PATCH] Fix nondeterministic behaviour in the CodeExtractor
On Jan 8, 2010, at 5:01 PM, Julien Lerouge wrote:
> Hello,
>
> The CodeExtractor contains a std::set<BasicBlock*> to keep track of
> the
> blocks to extract. Iterators on this set are not deterministic, and so
> the functions that are generated are not (the order of the
> inputs/outputs can change).
>
> The attached patch uses a SetVector instead. Ok to apply ?
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
2017 Nov 29
4
CodeExtractor buggy?
Hi All,
I’m currently working on a simple task which needs to transform loops into tail-recursive functions. I found the CodeExtractor class a handy helper to use, but later encountered a problem.
Consider the following CU
struct S { int a, b; };
int foo(struct S *s, unsigned n) {
struct S *next = s;
unsigned i;
for (i = 0; i < n; ++i) {
if (!s[i].a)
2013 Nov 18
2
[LLVMdev] CodeExtractor status?
I am working on a pass to extract small regions of code to run somewhere else (different node in a cluster). Basically what I need is the ability to isolate a region of code, get its inputs and outputs, create a new function with the extracted code and code aggregating the in and out parameters as structs that can be cast for a “void*”-based interface.
It looks like the CodeExtractor
2009 May 08
2
[LLVMdev] Splitting a basic block, replacing it's terminator
Hi,
I want to insert a conditional branch in the middle of a basic block.
To that end, I am doing these steps:
(1) Split the basic block:
bb->splitBasicBlock()
(2) Remove the old terminator:
succ->removePredecessor(bb)
bb->getTerminator()->getParent()
(3) Adding a new terminator:
BranchInst::Create(ifTrue, ifFalse, cnd, "", bb);
That seems to work, but later passes
2014 Oct 30
2
[LLVMdev] Emit a jump instruction to a place inside basicblock
On Thu, Oct 30, 2014 at 2:33 PM, Robin Morisset <morisset at google.com> wrote:
> Hi,
>
> From my understanding of the LLVM IR, it is impossible to jump to the
> middle of a Basic Block, only to its beginning. But there is a
> splitBasicBlock function that seems like it might be useful to you, to make
> sure a basic block is starting at the exact place you want to jump.
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
2013 Nov 25
0
[LLVMdev] CodeExtractor status?
Hi Brandon,
> Did you have issues with the Verifier complaining about function-local
> metadata after moving blocks? Did you find a good solution for this?
>
It looks like you are moving blocks or instructions with attached
metadata to another function. Some metadata is function-specific, so the
verifier complains because the instruction/BB and the metadata don't
belong to the
2013 Nov 21
0
[LLVMdev] CodeExtractor status?
On 18/11/13 21:43, Brandon Holt wrote:
> I am working on a pass to extract small regions of code to run
> somewhere else (different node in a cluster). Basically what I need is
> the ability to isolate a region of code, get its inputs and outputs,
> create a new function with the extracted code and code aggregating the
> in and out parameters as structs that can be cast for a
2013 Mar 03
2
[LLVMdev] Question about method CodeExtractor::severSplitPHINodes
Thanks for reply Chuck.
Please excuse me if I'm not supposed to reply to all.
Are you saying all PHI nodes are required to include all its predecessor
blocks no matter they have input or not?
What about successor blocks? Are they optional if they don't provide inputs?
BTW, where should I look at to verify this, the mem2reg.cpp &
PromoteMemToReg.cpp?
Thanks a lot.
On Sat, Mar 2, 2013
2014 Oct 30
2
[LLVMdev] Emit a jump instruction to a place inside basicblock
On Thu, Oct 30, 2014 at 4:48 PM, Eric Christopher <echristo at gmail.com>
wrote:
>
>
> On Thu Oct 30 2014 at 1:16:38 PM Xiaoguang Wang <xgwang09 at gmail.com>
> wrote:
>
>> On Thu, Oct 30, 2014 at 2:33 PM, Robin Morisset <morisset at google.com>
>> wrote:
>>
>>> Hi,
>>>
>>> From my understanding of the LLVM IR, it is
2010 Jan 10
1
[LLVMdev] [PATCH] Fix nondeterministic behaviour in the CodeExtractor
On Fri, Jan 08, 2010 at 05:04:17PM -0800, Chris Lattner wrote:
> On Jan 8, 2010, at 5:01 PM, Julien Lerouge wrote:
> >Hello,
> >
> >The CodeExtractor contains a std::set<BasicBlock*> to keep track
> >of the
> >blocks to extract. Iterators on this set are not deterministic, and so
> >the functions that are generated are not (the order of the
>
2018 May 24
2
LLVM Pass To Remove Dead Code In A Basic Block
Hi Dean,
Thanks for your reply.
That's exactly what I am doing, but I was looking for a default
optimization or pass implementation if there was.
I used BasicBlock::splitBasicBlock() but it puts "br" end of original basic
block. I tried to delete the br instruction by using eraseFromParent() but
it didn't work.
I had to rewrite my own splitBasicBlock() by modifying the