[llvm] r179026 - Generate PPC early conditional returns

Chris Lattner clattner at apple.com
Mon Apr 8 18:04:17 PDT 2013


On Apr 8, 2013, at 9:24 AM, Hal Finkel <hfinkel at anl.gov> wrote:

> Author: hfinkel
> Date: Mon Apr  8 11:24:03 2013
> New Revision: 179026
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=179026&view=rev
> Log:
> Generate PPC early conditional returns
> 
> PowerPC has a conditional branch to the link register (return) instruction: BCLR.
> This should be used any time when we'd otherwise have a conditional branch to a
> return. This adds a small pass, PPCEarlyReturn, which runs just prior to the
> branch selection pass (and, importantly, after block placement) to generate
> these conditional returns when possible. It will also eliminate unconditional
> branches to returns (these happen rarely; most of the time these have already
> been tail duplicated by the time PPCEarlyReturn is invoked). This is a nice
> optimization for small functions that do not maintain a stack frame.

Hi Hal,

Should this just be a special case of general predication/if conversion?

-Chris



More information about the llvm-commits mailing list