[PATCH] Make sibling call opt work with common x86 callee pop conventions

Reid Kleckner rnk at google.com
Mon Mar 31 09:52:15 PDT 2014


  After talking to Chandler, I'm also going to work on adding a 'tailonly' attribute to call instructions.  The verifier will have a conservative set of rules for tailonly calls that ensure that we can perform the tail call.  The rules will be:

  - The call must occur prior to a ret instruction.
  - The ret must return the value produced by the call or void.
  - The caller and callee prototypes must be congruent.  Prototypes are congruent if all parameter types other than pointer types match, and pointer types only differ in pointee type.
  - Congruence includes ABI-impacting function attributes, like sret, byval, inalloca, and inreg.  Non-ABI attributes like noalias don't matter.

  This patch should stand on its own as generic improvement to our sibcall optimization.  I'm going to scrub the inalloca test cases, but aside from that, please review.

http://llvm-reviews.chandlerc.com/D3209



More information about the llvm-commits mailing list