similar to: [LLVMdev] Does call instruction (LLVM-IR) terminate a basic block?

Displaying 20 results from an estimated 30000 matches similar to: "[LLVMdev] Does call instruction (LLVM-IR) terminate a basic block?"

2010 Feb 05
0
[LLVMdev] Basic block with two return instructions
On Fri, Feb 5, 2010 at 11:30 AM, Russell Wallace <russell.wallace at gmail.com> wrote: > Ah! I didn't know about verifyFunction; it does indeed catch it, > thanks! I'll leave that call in my code for all cases for the moment, > should help identify problems like that. > > Is there a recommended way to avoid this problem when compiling a > language that has an
2010 Feb 05
2
[LLVMdev] Basic block with two return instructions
Ah! I didn't know about verifyFunction; it does indeed catch it, thanks! I'll leave that call in my code for all cases for the moment, should help identify problems like that. Is there a recommended way to avoid this problem when compiling a language that has an explicit and optional return statement? On Fri, Feb 5, 2010 at 5:25 PM, Garrison Venn <gvenn.cfe.dev at gmail.com> wrote:
2017 Nov 11
2
Update control flow graph when splitting a machine basic block?
Thank you for your reply! > Every MachineBasicBlock has a list of successors; you can access it with > the successors() accessor. That's what you should be using for any CFG > analysis. I am aware of these methods of class MachineBasicBlock, which allows one to access a MachineBasicBlock's successors and predecessors in the CFG. But the CFG itself may no longer be valid if a
2018 May 24
0
LLVM Pass To Remove Dead Code In A Basic Block
> On 25 May 2018, at 01:46, Aaron via llvm-dev <llvm-dev at lists.llvm.org> wrote: > > Hi all, > > LLVM optimization pass gives an error "Terminator found in the middle of a basic block!" since basic block IR may have multiple "ret" instructions. It seems LLVM does not accept multiple return in a basic block by default. > Yes, if you’re inserting
2018 May 24
2
LLVM Pass To Remove Dead Code In A Basic Block
Hi all, LLVM optimization pass gives an error "Terminator found in the middle of a basic block!" since basic block IR may have multiple "ret" instructions. It seems LLVM does not accept multiple return in a basic block by default. Is there a specific optimization or pass that I can enable to remove unreachable codes in basic blocks? Best, Aaron -------------- next part
2017 Nov 11
2
Update control flow graph when splitting a machine basic block?
> The right way to update the CFG very much depends on how you're > transforming it. I would like to export the CFG for control flow checking. Theoretically, it should be possible for a compiler to know every target of every control flow instruction, except for computed targets that are not known at compile-time. When a machine basic block is split between two branches, as shown below:
2003 Nov 20
3
[LLVMdev] Basic Block Chaining
Newbie Question .. (sorry if its redundant/silly) .. As I've started to develop Stacker, I had assumed that simply adding BasicBlocks to a function in sequence would imply that there is an implicit unconditional branch from the end of one basic block to the start of the next block. Based on the assertion checks that I get when I tried this, I assume that it is required to place a terminating
2017 Nov 10
2
Update control flow graph when splitting a machine basic block?
Hi, there! There are situations where a machine basic block has to be split into two machine basic blocks, e.g., to place a constant pool entry or to fix a conditional branch so that its target is within its range (https://reviews.llvm.org/D38918). However, it doesn't appear to be straightforward how the control flow graph should be updated when a machine basic block is split,
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
2011 Oct 18
3
[LLVMdev] Question regarding basic-block placement optimization
On Tue, Oct 18, 2011 at 2:59 PM, Cameron Zwarich <zwarich at apple.com> wrote: > On Oct 18, 2011, at 2:53 AM, Chandler Carruth wrote: > > > Hello, > > > > I'm working on basic-block placement optimizations based on branch > probability information. I've run into a stumbling block though. One of the > existing passes to do this, essentially a dead pass
2011 Oct 19
0
[LLVMdev] Question regarding basic-block placement optimization
On Wed, Oct 19, 2011 at 3:24 AM, Chandler Carruth <chandlerc at google.com>wrote: > On Tue, Oct 18, 2011 at 6:58 PM, Jakob Stoklund Olesen <stoklund at 2pi.dk>wrote: > >> >> On Oct 18, 2011, at 5:22 PM, Chandler Carruth wrote: >> >> As for why it should be an IR pass, mostly because once the selection >>> dag runs through the code, we can never
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
2011 Oct 19
0
[LLVMdev] Question regarding basic-block placement optimization
On Oct 18, 2011, at 5:22 PM, Chandler Carruth wrote: >> As for why it should be an IR pass, mostly because once the selection dag runs through the code, we can never recover all of the freedom we have at the IR level. To start with, splicing MBBs around requires known about the terminators (which we only some of the time do), and it requires re-writing them a touch to account for the
2011 Oct 19
3
[LLVMdev] Question regarding basic-block placement optimization
On Tue, Oct 18, 2011 at 4:31 PM, Jakob Stoklund Olesen <stoklund at 2pi.dk>wrote: > > On Oct 18, 2011, at 3:07 PM, Chandler Carruth wrote: > > On Tue, Oct 18, 2011 at 2:59 PM, Cameron Zwarich <zwarich at apple.com>wrote: > >> I think this should really live as a CodeGen pass. Is there any good >> reason to make it an IR pass? >> > > So, as it
2012 Nov 10
1
[LLVMdev] error: terminator in the middle of basic block
Hello, I modified the PathProfiling.cpp and run opt -inesrt-path-profiling. it works correctly ,but after path-profile is complete in Verifier::visitTerminatorInst it prints "Terminator found in the middle of a basic block!" . error is I added two basic blocks after return basic block and return has br label %newprint when printed in pathprofile module but in
2012 Jun 21
1
[LLVMdev] Is NASM supported by LLVM?
Could generated assembly with option "-x86-asm-symtab=intel" be assembled by nasm directly? On Thu, Jun 21, 2012 at 2:30 PM, Sean Silva <silvas at purdue.edu> wrote: > If by "NASM format" you mean Intel syntax, then yes. In my experience most > LLVM tools refer to it with the option "-x86-asm-syntax=intel". For > example, tools/llvm-objdump has this
2011 Oct 18
0
[LLVMdev] Question regarding basic-block placement optimization
On Oct 18, 2011, at 3:07 PM, Chandler Carruth wrote: > On Tue, Oct 18, 2011 at 2:59 PM, Cameron Zwarich <zwarich at apple.com> wrote: > I think this should really live as a CodeGen pass. Is there any good reason to make it an IR pass? > > So, as it happens, I was *completely* wrong here. CodeGen correctly preserves the ordering of blocks from IR, *unless* it can do folding,
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 Feb 05
2
[LLVMdev] Basic block with two return instructions
When I generate a simple function with a single basic block with two return instructions, I had expected that if it did anything at all, it would use the first one, but it actually seems to ignore the first one and take the value of the second one. I'm guessing what's going on here is something like "a basic block must end in exactly one terminator instruction, having two of them is
2010 Feb 05
2
[LLVMdev] Basic block with two return instructions
Fair enough. In that case, is there an elegant way to test whether a basic block already has a terminator instruction? (I can think of several ways to do it in the front-end, but all of them are fairly inelegant. The problem I'm trying to solve is things like 'a return instruction needs to be added to the end of a function, if and only if the programmer didn't already end the function