[PATCH] Top-Down FunctionAttrs propagation for noalias, dereferenceable and nonnull inference

hfinkel at anl.gov hfinkel at anl.gov
Tue Jul 22 05:54:05 PDT 2014


Updated based on Nick's comments; we need to ensure a stable answer for SCCs (which the df_iterator won't do).

The regular SCC iterator returns the SCCs bottom-up (it uses Tarjan's Algorithm, and knows it has found the root of an SCC as it passes it on the way up -- it is not clear there is a better way). Because we can't collect SCCs in a purely top-down fashion anyway, I've just changed it to store those returned by the bottom-up SCC iterator in a vector and visit this stored vector in reverse order. This pass does not modify the call graph, so this method should be stable.

In the future, we can get a better answer by speculating the attributes within each SCC, and then removing them afterward if call sites are found where the attributes can't be proved. I'll implement this as follow-up work.

http://reviews.llvm.org/D4609

Files:
  include/llvm-c/Transforms/IPO.h
  include/llvm/InitializePasses.h
  include/llvm/LinkAllPasses.h
  include/llvm/Transforms/IPO.h
  lib/LTO/LTOCodeGenerator.cpp
  lib/Transforms/IPO/CMakeLists.txt
  lib/Transforms/IPO/FunctionAttrsTD.cpp
  lib/Transforms/IPO/IPO.cpp
  lib/Transforms/IPO/PassManagerBuilder.cpp
  test/Transforms/FunctionAttrsTD/large-agg.ll
  test/Transforms/FunctionAttrsTD/malloc.ll
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D4609.11749.patch
Type: text/x-patch
Size: 20892 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140722/000d7cd7/attachment.bin>


More information about the llvm-commits mailing list