[LLVMdev] Question about 'DuplicateInstruction' function of TailDuplicatePass in CodeGen

jingu jingu at codeplay.com
Thu Jun 19 14:52:31 PDT 2014


Hi all,

Could someone comment about the email below please?

In particular, are there any problems with creating a bundle while 
cloning, or are there any passes that depend on the instructions being 
unbundled?

I am working on a new backend with LLVM. Your comments will be helpful 
for me to implement code.

Thanks,
JinGu Kang

On 2014-06-18 오전 12:00, JinGu Kang wrote:
> Hi all,
>
> I have faced a little bit of a strange transformation from the 
> TailDuplicatePass In CodeGen. When the pass clones the contents of 
> TailBB into PredBB, the bundled instructions in TailBB are not bundled 
> in PredBB. I think the reason why it is not bundled is that the 
> 'DuplicateInstruction' function does not set up the flag of the first 
> instruction of the bundle in PredBB when it is cloned from TailBB. If 
> the first instruction of the bundle is set up in PredBB, the 
> 'MachineBasicBlock->insert()' function would automatically put the 
> next instructions into the bundle. How do you feel about this?
>
> I did not find the API in order to make the first instruction of the 
> bundle. I have added simple code to make bundled instructions from the 
> 'DuplicateInstruction' function. As a reference, I have attached a 
> simple patch. If there is something wrong, please let me know.
>
> Thanks,
> JinGu Kang
>
>
>




More information about the llvm-dev mailing list