Displaying 20 results from an estimated 10000 matches similar to: "[LLVMdev] Splitting a basic block creates an instruction without debug metadata"
2010 Oct 28
0
[LLVMdev] Splitting a basic block creates an instruction without debug metadata
On Oct 27, 2010, at 5:53 PM, Trevor Harmon wrote:
> Hi,
>
> I'm not sure if this is really a problem or not, but I noticed that if
> you're working with bitcode that has debug metadata, and you split a
> BasicBlock using llvm::SplitBlock or BasicBlock::splitBasicBlock, the
> unconditional branch added to the new block will lack debug metadata.
> This turned
2010 Oct 21
2
[LLVMdev] Splitting basic blocks while preserving machine code
Hi,
I'm writing a pass that does some static analysis on C code. A
critical requirement of the pass is that it must preserve not only the
correctness of the code but also its timing -- It cannot add or remove
even one CPU cycle from the resulting machine code. To put it another
way, the binary executable that is produced when the pass is present
must be identical to what is produced
2010 Oct 21
0
[LLVMdev] Splitting basic blocks while preserving machine code
On Oct 20, 2010, at 5:16 PM, Trevor Harmon wrote:
> I'm writing a pass that does some static analysis on C code. A
> critical requirement of the pass is that it must preserve not only the
> correctness of the code but also its timing -- It cannot add or remove
> even one CPU cycle from the resulting machine code. To put it another
> way, the binary executable that is
2010 Oct 21
2
[LLVMdev] Splitting basic blocks while preserving machine code
On Wed, Oct 20, 2010 at 7:19 PM, Jim Grosbach <grosbach at apple.com> wrote:
>
> On Oct 20, 2010, at 5:16 PM, Trevor Harmon wrote:
>> I'm writing a pass that does some static analysis on C code. A
>> critical requirement of the pass is that it must preserve not only the
>> correctness of the code but also its timing -- It cannot add or remove
>> even one CPU
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,
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 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
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
2009 May 08
0
[LLVMdev] Splitting a basic block, replacing it's terminator
On May 8, 2009, at 4:02 PM, Nick Johnson wrote:
> 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()
Assuming that the new block will still be a
2010 Oct 21
0
[LLVMdev] Splitting basic blocks while preserving machine code
On Oct 20, 2010, at 5:26 PM, Kenneth Uildriks wrote:
> You could always undo the split right before your pass finishes.
How would I undo a split? Perhaps by merging them back using
llvm::MergeBlockIntoPredecessor?
Trevor
2017 May 26
2
Moving instructions from source Basic Block to dest Basic Block
Hi,
I have been trying to move some instructions between basic blocks ,
After looking at the API , I found llvm::Instruction::clone() but there
is no result value for this.
For example-
source Basic block :
continuation: ; preds = %else, %then
%iftmp = phi i32 [ 5, %then ], [ 9, %else ]
store i32 %iftmp, i32* %datasize
; 3 instructions below
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
2014 Oct 29
4
[LLVMdev] Emit a jump instruction to a place inside basicblock
Hi all,
I'm a beginner in LLVM. Currently, I want to implement a pass that
generates a jump table. The entry in that table is a jump to some place
(may be an instruction) in a basic block.
I'm reading the JumpTable code in llvm 3.5, there is a table which contains
jump entries to functions. In AsmPrinter::doFinalization function from file
lib/CodeGen/AsmPrinter/AsmPrinter.cpp, it gets a
2014 Jul 07
4
[LLVMdev] Splitting basic block results in unknown instruction type assertion
Hello,
I would like to see if this issue is a result of a misunderstanding on
my part before I file a bug. I am using LLVM 3.4, built from the
source tarballs. My system's uname is "Darwin tyler-air 12.5.0 Darwin
Kernel Version 12.5.0: Sun Sep 29 13:33:47 PDT 2013;
root:xnu-2050.48.12~1/RELEASE_X86_64 x86_64".
All I'm trying to do is add a runtime check after all call
2018 May 25
0
LLVM Pass To Remove Dead Code In A Basic Block
> On 25 May 2018, at 03:53, Aaron <acraft at gmail.com> wrote:
>
> 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.
>
There’s a dead code elimination pass, but it works with a control flow graph (it removes basic blocks that are unreachable after constant
2010 Jul 20
2
[LLVMdev] How to insert a basic block in an edge
Hi All,
Still I could not figure out how to use Pass* while calling
SplitEdge() function. Can anyone provide me some example?
Regards,
Chayan
On Sun, Jul 18, 2010 at 11:49 PM, Nick Lewycky <nicholas at mxc.ca> wrote:
> Chayan Sarkar wrote:
>>
>> Hi,
>>
>> I have tried to use SplitEdge function, but failed. Actually the third
>> parameter is a variable of
2010 Jul 21
0
[LLVMdev] How to insert a basic block in an edge
Hi,
I could not figure out, how to declare a Pass*. Can anyone give me an
example, how to use SplitEdge() function ?
Please help me out.
Regards,
Chayan
On Tue, Jul 20, 2010 at 10:12 AM, Chayan Sarkar <chayan.ju at gmail.com> wrote:
> Hi All,
>
> Still I could not figure out how to use Pass* while calling
> SplitEdge() function. Can anyone provide me some example?
>
>
2010 Jul 18
0
[LLVMdev] How to insert a basic block in an edge
Chayan Sarkar wrote:
> Hi,
>
> I have tried to use SplitEdge function, but failed. Actually the third
> parameter is a variable of type Pass and it need to be non-null. But I
> could not figure out how to use it. Please help me out.
The only reason it needs a non-NULL Pass* is to call llvm::SplitBlock
which uses P->getAnalysisIfAvailable unconditionally. Feel free to wrap
2014 Feb 14
2
[LLVMdev] DominatorTree not updated properly after calling the llvm::SplitBlock.
Hi Fellows,
I am writing a pass that requires the DominatorTree pass. In the
runOnFunction of my own pass, I call llvm::SplitBlock to split a block
(%for.end) at it's first insert point. Then, when I dump my dominator tree
immediately after, I can see the newly split %for.end.split, but its
DFSNumIn and DFSNumOut are not properly updated in llvm::SplitBlock (i.e.,
still the initialized
2010 May 28
2
[LLVMdev] Basic doubt related to Module::iterator
Hi,
Yeah I found that it is running LLVM's functions. The functions that are
running are:
main
llvm.dbg.func.start
llvm.dbg.stoppoint
scanf
llvm.dbg.region.end
But I dont want all the functions to be called as I am using Dominator
Trees and whenever I the statement
DominatorTree &DT = getAnalysis<DominatorTree>(F);
is encountered by functions other than main, it gives error.