[PATCH] D55063: [IR] Set nocapture attribute for va_start, va_end, and va_copy

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 3 13:05:50 PST 2018


efriedma added a comment.

As far as I know, for all in-tree targets, this should be fine... and for all ABIs I know of in common use. I'm a little nervous that it will eventually break some obscure platform where a va_list can somehow point to itself, though.  (At least, an implementation like that seems plausible.)

On a related note, I'm a little concerned that this missed optimization is actually covering up a bug: markTails() in TailRecursionElimination currently doesn't model the fact that on many targets, va_lists point to memory that's implicitly allocated on the stack, so it adds incorrect "tail" markings to certain calls.  (This is technically orthogonal, but it's much more likely to come up with this patch because people usually declare va_list as a local variable.)


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D55063/new/

https://reviews.llvm.org/D55063





More information about the llvm-commits mailing list