[PATCH] D30670: [Outliner] Add tail call support

Jessica Paquette via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 29 13:13:14 PDT 2017


paquette added a comment.

In https://reviews.llvm.org/D30670#713287, @echristo wrote:

> Hi Jessica,
>
> I noticed that this was committed without addressing my feedback about the boolean parameters, what's up? :)
>
> -eric


Oh whoops. I'm scatterbrained, that's what's up. I'll remove it in the next patch.

Actually, the next patch should end up re-architecting a lot of this so that I can handle some more variations on how functions should be outlined/constructed for the AArch64 outliner. Since we're *kind of* talking about this sort of thing, I'll just brain-dump what I'm thinking in here, just to verify whether or not it'd accomplish what you were getting at.

I was thinking was that everything that talks with the target should be in terms of the start/end `MachineBasicBlock::iterators` for each candidate. The target would then decide how/if that candidate should be outlined. This would mean that the outliner wouldn't have to actually know *how* things are outlined at all, which would make it easier to add target-specific features in the future.

For example,

  getOutliningBenefit(size_t SequenceSize, size_t Occurrences, bool CanBeTailCall)

would become something like

  callOverhead(MachineBasicBlock::iterator StartIt, MachineBasicBlock::iterator EndIt)
  functionOverhead(MachineBasicBlock::iterator StartIt, MachineBasicBlock::iterator EndIt)

And then the number of instructions taken up by an outlined sequence could be redefined as

//callOverhead(StartIt, EndIt)* NumOccurrences + functionOverhead(StartIt, EndIt) + SequenceSize//

I think this is somewhat less cumbersome and nicely divorces target-specific stuff from the main outlining pass. I do worry that it moves a little too much of the pass' functionality into [TargetName]InstrInfo though. What do you think?


https://reviews.llvm.org/D30670





More information about the llvm-commits mailing list