[GlobalOpt] Don't remove inalloca from varargs functions
authorArthur Eubanks <aeubanks@google.com>
Tue, 1 Nov 2022 18:37:10 +0000 (11:37 -0700)
committerArthur Eubanks <aeubanks@google.com>
Tue, 1 Nov 2022 20:04:05 +0000 (13:04 -0700)
commit8c49b01a1ee051ab2c09be4cffc83656ccc0fbe6
treebe829f037c04c6659264aa35f3daac8c1aa3140b
parentddcb2d19b372913b13f06a7824b49be57480718f
[GlobalOpt] Don't remove inalloca from varargs functions

Varargs and inalloca have a weird interaction where varargs are actually
passed via the inalloca alloca. Removing inalloca breaks the varargs
because they're still not passed as separate arguments.

Fixes #58718

Reviewed By: rnk

Differential Revision: https://reviews.llvm.org/D137182
llvm/lib/Transforms/IPO/GlobalOpt.cpp
llvm/test/Transforms/GlobalOpt/inalloca-varargs.ll [new file with mode: 0644]