]> granicus.if.org Git - llvm/commit
[Attributor] Implement "norecurse" function attribute deduction
authorHideto Ueno <uenoku.tokotoko@gmail.com>
Sat, 21 Sep 2019 15:13:19 +0000 (15:13 +0000)
committerHideto Ueno <uenoku.tokotoko@gmail.com>
Sat, 21 Sep 2019 15:13:19 +0000 (15:13 +0000)
commit48db51b0f214bb67c94ade2fa287ba96d3b4c10d
tree1518cc64caf4c7e6fea0c2a23956c904da050247
parentb3a6782005e789a8c747c79efcfa23df85dce13c
[Attributor] Implement "norecurse" function attribute deduction

Summary:
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.

Reviewers: jdoerfert, sstefan1

Reviewed By: jdoerfert

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D67751

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372475 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Transforms/IPO/Attributor.h
lib/Transforms/IPO/Attributor.cpp
test/Transforms/FunctionAttrs/norecurse.ll
test/Transforms/FunctionAttrs/willreturn.ll