[llvm] r309343 - [X86] Fix latent bug in sibcall eligibility logic

Hans Wennborg via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 31 09:46:01 PDT 2017


On Thu, Jul 27, 2017 at 5:58 PM, Reid Kleckner via llvm-commits
<llvm-commits at lists.llvm.org> wrote:
> Author: rnk
> Date: Thu Jul 27 17:58:35 2017
> New Revision: 309343
>
> URL: http://llvm.org/viewvc/llvm-project?rev=309343&view=rev
> Log:
> [X86] Fix latent bug in sibcall eligibility logic
>
> The X86 tail call eligibility logic was correct when it was written, but
> the addition of inalloca and argument copy elision broke its
> assumptions. It was assuming that fixed stack objects were immutable.
>
> Currently, we aim to emit a tail call if no arguments have to be
> re-arranged in memory. This code would trace the outgoing argument
> values back to check if they are loads from an incoming stack object.
> If the stack argument is immutable, then we won't need to store it back
> to the stack when we tail call.
>
> Fortunately, stack objects track their mutability, so we can just make
> the obvious check to fix the bug.
>
> This was http://crbug.com/749826

Merged to 5.0 in r309577.


More information about the llvm-commits mailing list