[llvm] r271925 - [MBP] Reduce code size by running tail merging in MBP.
Mikael Holmén via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 21 04:37:04 PDT 2016
On 06/20/2016 11:15 PM, Matthias Braun wrote:
>
>> On Jun 14, 2016, at 4:54 AM, Mikael Holmén via llvm-commits
>> <llvm-commits at lists.llvm.org <mailto:llvm-commits at lists.llvm.org>> wrote:
>>
>> Note that BB#2 both does a conditional jump AND falltrhoughs to BB#3.
>
> Yes this case is very unusual because normally CodeGenPrepare removes
> such pointless conditional branches. However I remember running into
> problems with this when the optnone attribute was specified
> (http://llvm.org/PR24581)
>
> You should be able to to construct a testcase for the existing targets
> with a .mir test which then just uses "llc -run-pass block-placement".
That's a good idea! I didn't even know about .mir tests, but I will
definitely try that out.
>
> An alternative to improving our test coverage for these corner cases
> would be to simply forbid the situation and checking in the machine
> verifier that when a block only has a single predecessor it must not use
> a conditional jump. Thereby forcing the code that today creates these
> situations to deal with them.
I don't mind this approach, but I have no idea what is best or how many
places where this situation can occur.
In this particular case it's MachineBlockPlacement itself that creates
the situation while doing (the newly introduced) tailmerging.
Thanks,
Mikael
>
> - Matthias
More information about the llvm-commits
mailing list