[PATCH] D68852: [Attributor] Pointer privatization attribute (argument promotion)

Johannes Doerfert via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 10 19:40:27 PDT 2019


jdoerfert created this revision.
jdoerfert added reviewers: uenoku, sstefan1, lebedev.ri, hfinkel, vsk, dblaikie, davidxl, tejohnson, tstellar, echristo, chandlerc, efriedma.
Herald added subscribers: arphaman, bollu, hiraditya.
Herald added a project: LLVM.
jdoerfert added a comment.

I went through all the tests, added mem2reg/sroa where approriate and modified the source sometimes, mostly to avoid UB. I think the results of the Attributor look good, all problems should have been addressed already.


A pointer is privatizeable if it can be replaced by a new, private one.
Privatizing pointer reduces the use count, interaction between unrelated
code parts. This is a first step towards replacing argument promotion.
While we can already handle recursion (unlike argument promotion!) we
are restricted to stack allocations for now because we do not analyze
the uses in the callee.

All argument promotion test now run the Attributor as well.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D68852

Files:
  llvm/include/llvm/Transforms/IPO/ArgumentPromotion.h
  llvm/include/llvm/Transforms/IPO/Attributor.h
  llvm/lib/Transforms/IPO/ArgumentPromotion.cpp
  llvm/lib/Transforms/IPO/Attributor.cpp
  llvm/test/Transforms/ArgumentPromotion/2008-02-01-ReturnAttrs.ll
  llvm/test/Transforms/ArgumentPromotion/2008-07-02-array-indexing.ll
  llvm/test/Transforms/ArgumentPromotion/2008-09-07-CGUpdate.ll
  llvm/test/Transforms/ArgumentPromotion/2008-09-08-CGUpdateSelfEdge.ll
  llvm/test/Transforms/ArgumentPromotion/X86/attributes.ll
  llvm/test/Transforms/ArgumentPromotion/X86/min-legal-vector-width.ll
  llvm/test/Transforms/ArgumentPromotion/X86/thiscall.ll
  llvm/test/Transforms/ArgumentPromotion/aggregate-promote.ll
  llvm/test/Transforms/ArgumentPromotion/attrs.ll
  llvm/test/Transforms/ArgumentPromotion/basictest.ll
  llvm/test/Transforms/ArgumentPromotion/byval-2.ll
  llvm/test/Transforms/ArgumentPromotion/byval.ll
  llvm/test/Transforms/ArgumentPromotion/chained.ll
  llvm/test/Transforms/ArgumentPromotion/control-flow.ll
  llvm/test/Transforms/ArgumentPromotion/control-flow2.ll
  llvm/test/Transforms/ArgumentPromotion/crash.ll
  llvm/test/Transforms/ArgumentPromotion/dbg.ll
  llvm/test/Transforms/ArgumentPromotion/fp80.ll
  llvm/test/Transforms/ArgumentPromotion/inalloca.ll
  llvm/test/Transforms/ArgumentPromotion/invalidation.ll
  llvm/test/Transforms/ArgumentPromotion/musttail.ll
  llvm/test/Transforms/ArgumentPromotion/naked_functions.ll
  llvm/test/Transforms/ArgumentPromotion/nonzero-address-spaces.ll
  llvm/test/Transforms/ArgumentPromotion/pr27568.ll
  llvm/test/Transforms/ArgumentPromotion/pr3085.ll
  llvm/test/Transforms/ArgumentPromotion/pr32917.ll
  llvm/test/Transforms/ArgumentPromotion/pr33641_remove_arg_dbgvalue.ll
  llvm/test/Transforms/ArgumentPromotion/profile.ll
  llvm/test/Transforms/ArgumentPromotion/reserve-tbaa.ll
  llvm/test/Transforms/ArgumentPromotion/sret.ll
  llvm/test/Transforms/ArgumentPromotion/tail.ll
  llvm/test/Transforms/ArgumentPromotion/variadic.ll
  llvm/test/Transforms/FunctionAttrs/callbacks.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D68852.224526.patch
Type: text/x-patch
Size: 157660 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191011/c7b5a0a1/attachment-0001.bin>


More information about the llvm-commits mailing list