[PATCH] D89819: [ArgumentPromotion] Fix byval alignment handling.

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 20 13:17:37 PDT 2020


efriedma created this revision.
efriedma added reviewers: fhahn, craig.topper.
Herald added subscribers: pengfei, hiraditya.
Herald added a project: LLVM.
efriedma requested review of this revision.

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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D89819

Files:
  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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D89819.299451.patch
Type: text/x-patch
Size: 17659 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201020/7e93c59b/attachment.bin>


More information about the llvm-commits mailing list