[PATCH] D14228: [FunctionAttrs] Identify norecurse functions

James Molloy via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 6 05:37:48 PST 2015


jmolloy updated this revision to Diff 39515.
jmolloy added a comment.

Hi,

Thanks all for the feedback. This new version is rebased to HEAD on top of Chandler's changes, and improves the way the algorithm works.

I've added an extra inference rule - if a function F has only one callsite and that callsite is itself in a norecurse function, then F cannot recurse. Obviously this lends itself to top-down propagation rather than the bottom-up propagation we get with SCC passes.

Now, we do the same bottom-up approach but if we see a function that is not obviously recursive but can't be proven non-recursive we save it and after the SCC is over we go and revisit it, top-down. This allows more functions to be marked norecurse.

I think I've acted on all the review comments so far, and I've added more comments into the code to make it clearer what's going on.

Cheers,

James


Repository:
  rL LLVM

http://reviews.llvm.org/D14228

Files:
  lib/Transforms/IPO/FunctionAttrs.cpp
  test/Analysis/TypeBasedAliasAnalysis/functionattrs.ll
  test/Transforms/FunctionAttrs/2008-09-03-ReadNone.ll
  test/Transforms/FunctionAttrs/2010-10-30-volatile.ll
  test/Transforms/FunctionAttrs/atomic.ll
  test/Transforms/FunctionAttrs/norecurse.ll
  test/Transforms/FunctionAttrs/optnone.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D14228.39515.patch
Type: text/x-patch
Size: 8660 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151106/a44dce10/attachment.bin>


More information about the llvm-commits mailing list