[PATCH] D41633: [InstCombine] Remove unneeded VarArg casts.
Reid Kleckner via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 2 12:39:08 PST 2018
rnk added a comment.
In https://reviews.llvm.org/D41633#965959, @efriedma wrote:
> There are many ABIs with special cases for varargs. The x86-64 Linux ABI specifically defines that vararg calls need to initialize AL, and other calls don't. The hard-float ABI on ARM Linux usually pass "double" arguments in floating-point regsiters, but varargs functions pass them in integer registers. Other ABIs might do more exotic things I'm not thinking of.
> If you can prove the callee is in fact not a varargs function, you might be able to do something like this, but the type of a function declaration isn't enough to prove that.
Makes sense. Fortunately, we can prove the callee is not varargs in exactly the circumstances that matter: when we would be able to inline, i.e. we have a non-interposable definition.
More information about the llvm-commits