[ArgumentPromotion] Fix byval alignment handling.
authorEli Friedman <efriedma@quicinc.com>
Tue, 20 Oct 2020 20:08:07 +0000 (13:08 -0700)
committerEli Friedman <efriedma@quicinc.com>
Tue, 11 May 2021 18:22:18 +0000 (11:22 -0700)
commit61cbbba7a645a1d87db9a80867c84a788ab2ea9c
treefd02f29fd630f2e4001478f263c35a30eba7397d
parent49755871ad0c24ed970c0a4f2c51f90488b0ddd2
[ArgumentPromotion] Fix byval alignment handling.

Make sure the alignment of the generated operations matches the
alignment of the byval argument.  Previously, we were just ignoring
alignment and getting lucky.

While I'm here, also delete the unnecessary "tail" handling.
Passing a pointer to a byval argument to a "tail" call is UB, so
rewriting to an alloca doesn't require any special handling.

Differential Revision: https://reviews.llvm.org/D89819
llvm/lib/Transforms/IPO/ArgumentPromotion.cpp
llvm/test/Transforms/ArgumentPromotion/attrs.ll
llvm/test/Transforms/ArgumentPromotion/byval-2.ll
llvm/test/Transforms/ArgumentPromotion/byval.ll
llvm/test/Transforms/ArgumentPromotion/dbg.ll
llvm/test/Transforms/ArgumentPromotion/tail.ll [deleted file]