Remove the user-count threshold when analyzing read attributes
authorJingyue Wu <jingyue@google.com>
Fri, 24 Jul 2015 19:05:53 +0000 (19:05 +0000)
committerJingyue Wu <jingyue@google.com>
Fri, 24 Jul 2015 19:05:53 +0000 (19:05 +0000)
commitab0a70d3a3e96c5af40010ca52199ccf2d7c20d8
tree6369ad73b6dfda2c115e7327a40d64f8a85647c7
parentec2871f730c3ce8d7009b5cb9a751fef8d41ab9d
Remove the user-count threshold when analyzing read attributes

Summary:
This threshold limited FunctionAttrs ability to prove arguments to be read-only.
In NVPTX, a specialized instruction ld.global.nc can be used to load memory
with non-coherent texture cache. We notice that in SHOC [1] benchmark, some
function arguments are not marked with readonly because FunctionAttrs reaches
a hardcoded threshold when analysis uses.

Removing this threshold won't cause significant regression in compilation time, because the worst-case time complexity of the algorithm is still O(# of instructions) for each parameter.

Patched by Xuetian Weng.

[1] https://github.com/vetter/shoc

Reviewers: nlewycky, jingyue, nicholas

Subscribers: nicholas, test, llvm-commits

Differential Revision: http://reviews.llvm.org/D11311

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243141 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/IPO/FunctionAttrs.cpp