[PATCH] D67751: [Attributor] Implement "norecurse" function attribute deduction

Hideto Ueno via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 19 01:56:07 PDT 2019


uenoku created this revision.
uenoku added reviewers: jdoerfert, sstefan1.
Herald added subscribers: llvm-commits, hiraditya.
Herald added a project: LLVM.

This patch introduces `norecurse` function attribute deduction.

`norecurse` will be deduced if the following conditions hold:

- The size of SCC in which the function belongs equals to 1.
- The function doesn't have self-recursion.
- We have `norecurse` for all call site.

To avoid a large change, SCC is calculated using scc_iterator in InfoCache initialization for now.


https://reviews.llvm.org/D67751

Files:
  llvm/include/llvm/Transforms/IPO/Attributor.h
  llvm/lib/Transforms/IPO/Attributor.cpp
  llvm/test/Transforms/FunctionAttrs/norecurse.ll
  llvm/test/Transforms/FunctionAttrs/willreturn.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D67751.220826.patch
Type: text/x-patch
Size: 15828 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190919/4b02149b/attachment.bin>


More information about the llvm-commits mailing list