[AArch64][GlobalISel] Any-extend vararg parameters to stack slot size on Darwin.
authorAmara Emerson <aemerson@apple.com>
Mon, 2 Jul 2018 16:39:09 +0000 (16:39 +0000)
committerAmara Emerson <aemerson@apple.com>
Mon, 2 Jul 2018 16:39:09 +0000 (16:39 +0000)
commit846f2436e8cdebc963c5920a0579dd8af643513f
tree33e6c51fdcbae6b3f10d4b9ba58d040ad1e63523
parenta0b18afa7dfd15ccb83362ccae7ec5b2438e4e2b
[AArch64][GlobalISel] Any-extend vararg parameters to stack slot size on Darwin.

We currently don't any-extend vararg parameters before storing them to the stack
locations on Darwin. However, SelectionDAG however does this, and so user code
is in the wild which inadvertently relies on this extension. This can manifest
in cases where the value stored is (int)0, but the actual parameter is interpreted
by va_arg as a pointer, and so not extending to 64 bits causes the callee to
load additional undefined bits.

llvm-svn: 336120
llvm/lib/Target/AArch64/AArch64CallLowering.cpp
llvm/test/CodeGen/AArch64/GlobalISel/arm64-callingconv-ios.ll