[PATCH] D78719: [Attributor] Inititialize "value attributes" w/ must-be-executed-context info

Johannes Doerfert via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 23 09:11:21 PDT 2020


jdoerfert created this revision.
jdoerfert added reviewers: lebedev.ri, fhahn.
Herald added subscribers: uenoku, bollu, hiraditya.
Herald added a reviewer: sstefan1.
Herald added a reviewer: uenoku.
Herald added a project: LLVM.

Attributes that only depend on the value (=bit pattern) can be
initialized from uses in the must-be-executed-context (MBEC). We did use
`AAComposeTwoGenericDeduction` and `AAFromMustBeExecutedContext` before
to do this for some positions of these attributes but not for all. This
was fairly complicated and also problematic as we did run it in every
`updateImpl` call even though we only use known information. The new
implementation removes `AAComposeTwoGenericDeduction`* and
`AAFromMustBeExecutedContext` in favor of a simple interface
`AddInformation::fromMBEContext(...)` which we call from the
`initialize` methods of the "value attribute" `Impl` classes, e.g.
`AANonNullImpl:initialize`.

There can be two types of test changes:

1. Artifacts were we miss some information that was known before a global fixpoint was reached and therefore available in an update but not at the beginning.
2. Deduction for values we did not derive via the MBEC before or which were not found as the `AAFromMustBeExecutedContext::updateImpl` was never invoked.

- An improved version of AAComposeTwoGenericDeduction can be found in D78718 <https://reviews.llvm.org/D78718>. Once we find a new use case that implementation will be able to handle "generic" AAs better.

---

Single run of the Attributor module and then CGSCC pass (oldPM)
for SPASS/clause.c (~10k LLVM-IR loc):

Before:

  calls to allocation functions: 425018 (318843/s)
  temporary memory allocations: 77284 (57977/s)
  peak heap memory consumption: 17.24MB
  peak RSS (including heaptrack overhead): 102.42MB
  total memory leaked: 269.07KB

After:

  calls to allocation functions: 511289 (241858/s)
  temporary memory allocations: 101680 (48098/s)
  peak heap memory consumption: 12.98MB
  peak RSS (including heaptrack overhead): 95.53MB
  total memory leaked: 269.07KB

Difference:

  calls to allocation functions: 86271 (110462/s)
  temporary memory allocations: 24396 (31236/s)
  peak heap memory consumption: -4.26MB
  peak RSS (including heaptrack overhead): 0B
  total memory leaked: 0B


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D78719

Files:
  llvm/lib/Transforms/IPO/AttributorAttributes.cpp
  llvm/test/Transforms/Attributor/ArgumentPromotion/attrs.ll
  llvm/test/Transforms/Attributor/ArgumentPromotion/byval-2.ll
  llvm/test/Transforms/Attributor/ArgumentPromotion/byval.ll
  llvm/test/Transforms/Attributor/ArgumentPromotion/control-flow2.ll
  llvm/test/Transforms/Attributor/ArgumentPromotion/fp80.ll
  llvm/test/Transforms/Attributor/ArgumentPromotion/live_called_from_dead_2.ll
  llvm/test/Transforms/Attributor/ArgumentPromotion/musttail.ll
  llvm/test/Transforms/Attributor/ArgumentPromotion/tail.ll
  llvm/test/Transforms/Attributor/IPConstantProp/2009-09-24-byval-ptr.ll
  llvm/test/Transforms/Attributor/IPConstantProp/openmp_parallel_for.ll
  llvm/test/Transforms/Attributor/callbacks.ll
  llvm/test/Transforms/Attributor/read_write_returned_arguments_scc.ll
  llvm/test/Transforms/Attributor/value-simplify.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D78719.259586.patch
Type: text/x-patch
Size: 71980 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200423/23415478/attachment-0001.bin>


More information about the llvm-commits mailing list