[PATCH] D28167: Create as few pieces of an argument as possible when promoting an argument.

Xin Tong via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 29 13:49:30 PST 2016


trentxintong created this revision.
trentxintong added reviewers: rnk, majnemer.
trentxintong added a subscriber: llvm-commits.

Create as few pieces of an argument as possible when promoting an argument.
When LLVM finds a by-ref argument is only read by the callee and its the safe to dereference.
It could choose to promote this argument to one or more value arguments. Currently it goes through
all the loads and create them at every callsites.

This patch minimize the # of arguments passed in. i.e. If we have an argument thats completely
part of another argument (due to gep in the callee), we do not need to pass in this argument,
instead we do extractvalue from the other argument.


https://reviews.llvm.org/D28167

Files:
  lib/Transforms/IPO/ArgumentPromotion.cpp
  test/Transforms/ArgumentPromotion/aggregate-promote-overlapping.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D28167.82693.patch
Type: text/x-patch
Size: 6277 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161229/bcbb8eb2/attachment.bin>


More information about the llvm-commits mailing list