[LLVMdev] Question About Cloning Machine Basic Block

Hisham Chowdhury hisham_chow at yahoo.com
Mon Apr 26 11:19:59 PDT 2010


Hello Sanjiv,
Thanks a lot for your help. What I am trying to do is to duplicate a MachineBasicBlock(also the BasicBlock which will reside inside MBB) and insert it as a new block in the machine function. Property of the new MBB will be identical to the other existing MBB in the MF. I am using same virtual register numbers for both. By doing this, I am running into some asserts when destroying the register use list

Snippet of Mchine Function Dump:
cond.false.i: 02715A34, LLVM BB @02BBE978, ID#4:
    Predecessors according to CFG: 0271595C (#2)
        %reg1057<def> = IGHAL_MOV_I32_RI 0
        %reg1104<def> = IGHAL_MOV_I32_RR %reg1057
    Successors according to CFG: 02715AA0 (#5)

cond.false.icopy: 0279455C, LLVM BB @02E9DEE8, ID#18:
    Predecessors according to CFG: 027158AC (#1)
        %reg1057<def> = IGHAL_MOV_I32_RI 0
        %reg1104<def> = IGHAL_MOV_I32_RR %reg1057
    Successors according to CFG: 02715AA0 (#5)

cond.end.i: 02715AA0, LLVM BB @02BBEAB8, ID#5:
    Predecessors according to CFG: 027159C8 (#3) 02715A34 (#4) 0279455C (#18)
        %reg1031<def> = IGHAL_MOV_I32_RR %reg1104


The Error i am getting is:
While deleting: label %cond.end.i
Use still stuck around after Def is destroyed:  br label %cond.end.i

Assertion failed: use_empty() && "Uses remain when a value is destroyed!", file
c:\ocl\llvm\ms1.0\gfx_opencl_opensource\llvm\lib\vmcore\value.cpp, line 65


Do i need to change the property of the regsiter used inside the copy block to get rid of the error?

Appreciate all the help,


--- On Thu, 4/15/10, Sanjiv Gupta <sanjiv.gupta at microchip.com> wrote:

> From: Sanjiv Gupta <sanjiv.gupta at microchip.com>
> Subject: Re: [LLVMdev] Question About Cloning Machine Basic Block
> To: "Hisham Chowdhury" <hisham_chow at yahoo.com>
> Cc: llvmdev at cs.uiuc.edu
> Date: Thursday, April 15, 2010, 8:19 PM
> 
> On Wed, 2010-04-14 at 17:30 -0700, Hisham Chowdhury wrote:
>> > 
> > 
> > -          Is there a utility
> to clone a MachineBasicBlock in LLVM
> > 
> > 
> > 
>> >          
> > 
> There is CloneBasicBlock routine
> in ./lib/Transforms/Utils/CloneFunction.cpp
> 
> - Sanjiv
> 
> > _______________________________________________
> > LLVM Developers mailing list
> > LLVMdev at cs.uiuc.edu 
>        http://llvm.cs.uiuc.edu
> > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
> 
> 
> 


      




More information about the llvm-dev mailing list