[LLVMdev] Problem using a label to a MachineBasicBlock

Jeroen Dobbelaere Jeroen.Dobbelaere at synopsys.com
Fri Mar 23 02:21:51 PDT 2012


Hi Abhishek,

A good example for splitting basic blocks is in 'MBlazeTargetLowering::EmitCustomSelect' in
lib/Target/MBlaze/MBlazeISelLowering.cpp.

In your case, you will not create the 'flsBB' basic block, but only the 'dneBB'.
The 'splice' function is doing the actual split of the basic block.


btw. In my final solution for my original problem, I stopped splitting the basic block, but I inserted
a 'GC_LABEL' at the correct place. (This type of label is treated in the way that I needed,
although I did not need it for garbage collection).

Greetings,

Jeroen Dobbelaere


> -----Original Message-----
> From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu]
> On Behalf Of Abhishek Rhisheekesan
> Sent: Thursday, March 22, 2012 12:50 PM
> To: llvmdev at cs.uiuc.edu
> Subject: Re: [LLVMdev] Problem using a label to a MachineBasicBlock
> 
> 
> Can you please post the code to split a MachineBasicBlock?
> 
> I am trying to split a MachineBasicBlock at a specific instruction in
> the
> MBB, let us say, into MBB1 and MBB2. This instruction should go into
> MBB2.
> Also MBB1 should have an unconditional branch to MBB2 as the
> terminator.
> (quite similar to splitBasicBlock in BasicBlock.cpp)
> 
> Meanwhile, I am trying to come up with a variant of SplitCriticalEdge
> to do
> this but if someone can provide the code to split a MBB, it will be of
> great
> help.
> 
> 
[...]





More information about the llvm-dev mailing list