[PATCH] D41633: [InstCombine] Remove unneeded VarArg casts.

John McCall via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 2 13:00:20 PST 2018

rjmccall added a comment.

I think at least one of the MIPS ABIs does the same thing with varargs as AArch64 on Darwin.

Eli is right, the type of a function declaration is totally irrelevant under current IR semantics.  The only thing that contributes to the CC of a call is the combination of (1) the type of the callee value, (2) the named calling convention, and (3) the attributes on the call site.  I can declare malloc as taking three floats and returning void, and as long as I cast it to i8* (i64)* at every call site, everything should work.  If you can prove that you have the dynamic definition of the callee, you can apply UB rules, but you don't have that here — you don't have a definition at all.


More information about the llvm-commits mailing list