[llvm-commits] [LLVMdev] [PATCH] Remove instruction within a bundle

Andrew Trick atrick at apple.com
Wed Jun 6 12:24:09 PDT 2012


On Jun 6, 2012, at 12:50 AM, Ivan Llopard <ivanllopard at gmail.com> wrote:
> On 05/06/2012 23:48, Andrew Trick wrote:
>> 
>> On Jun 5, 2012, at 12:43 AM, Ivan Llopard <ivanllopard at gmail.com> wrote:
>> 
>>> Hi again!
>>> 
>>> I don't know if I should send patches for review to llvmdev or llvmcommits so I forward my original message sent to llvmdev.
>>> 
>>> Thanks,
>>> Ivan
>>> 
>>> 
>>> -------- Original Message --------
>>> Subject:	[LLVMdev] [PATCH] Remove instruction within a bundle
>>> Date:	Sun, 03 Jun 2012 17:17:47 +0200
>>> From:	Ivan Llopard <ivanllopard at gmail.com>
>>> To:	LLVM Developers Mailing List <llvmdev at cs.uiuc.edu>
>>> 
>>> Hi,
>>> 
>>> I've raised an assertion when I tried to remove an instruction within a 
>>> bundle by calling eraseFromParent(). It seems that in order to erase the 
>>> MI, a bundle iterator is created but it's forbidden if the MI is not the 
>>> bundle's header. The attached patch fix it.
>>> As a test case, call eraseFromParent() on a machine instruction with its 
>>> isInsideBundle flag activated.
>>> 
>>> Ivan
>> 
>> llvm-commits is the place for patches.
>> 
>> I committed this with a comment in r158025.
> 
> Thanks!
> 
>> 
>> I realize it's nearly impossible to come up with a unit test. I was hoping to create a testing mode for MachineInstrBundles but never got to it. Contributions welcome.
> 
> Do you have any idea on how to implement it? I'd like to contribute in my free time.

You could probably catch some bugs with a fuzz bundler. In the MachineScheduler you could arbitrarily bundle instruction sequences of random length, and unbundle them later, probably just before postRA scheduling. This should work on any target, but may require formalizing some constraints or limitations on legal bundles, which is probably a good exercise. This won't capture all classes of bugs though. Other ideas are also welcome :)

-Andy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120606/89e3c03a/attachment.html>


More information about the llvm-commits mailing list