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

Evan Cheng evan.cheng at apple.com
Thu Jun 19 17:21:18 PDT 2014


I have a hard time following your description. I think you need to provide code snippets and illustrate the problem better.

That said, I don't think your simple patch is safe. Tail duplication shouldn't partially duplicate a bundle. Either the entire bundle is duplicated or it should not be duplicated at all.

Evan

On Jun 19, 2014, at 2:52 PM, jingu <jingu at codeplay.com> wrote:

> 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
>> 
>> 
>> 
> 
> _______________________________________________
> 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