[PATCH] D53554: [Argument Promotion] Only promote args when function attributes are compatible

Tom Stellard via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 22 21:41:36 PDT 2018


tstellar created this revision.
tstellar added reviewers: echristo, chandlerc, eli.friedman, craig.topper.

Check to make sure that the caller and the callee have compatible
function arguments before promoting arguments.  This uses the same
TargetTransformInfo queries that are used to determine if attributes
are compatible for inlining.

The goal here is to avoid breaking ABI when a called function's ABI
depends on a target feature that is not enabled in the caller.

This is a very conservative fix for PR37358.  Ideally we would have a more
sophisticated check for ABI compatiblity rather than checking if the
attributes are compatible for inlining.


Repository:
  rL LLVM

https://reviews.llvm.org/D53554

Files:
  lib/Transforms/IPO/ArgumentPromotion.cpp
  test/Transforms/ArgumentPromotion/X86/attributes.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D53554.170568.patch
Type: text/x-patch
Size: 6166 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181023/906d9821/attachment.bin>


More information about the llvm-commits mailing list