OSDN Git Service

Add some shortcuts in LazyValueInfo to reduce compile time of Correlated Value Propag...
authorWei Mi <wmi@google.com>
Thu, 15 Sep 2016 06:28:34 +0000 (06:28 +0000)
committerWei Mi <wmi@google.com>
Thu, 15 Sep 2016 06:28:34 +0000 (06:28 +0000)
commit0bcb8fb9507eaaaea8339be9e0fae4fc086aa698
tree9f2e040090460bc6cf0b27f33770a8339c1168d7
parentf158709ee5929b3f6df34a0df9ac2ab67eb3a04a
Add some shortcuts in LazyValueInfo to reduce compile time of Correlated Value Propagation.

The patch is to partially fix PR10584. Correlated Value Propagation queries LVI
to check non-null for pointer params of each callsite. If we know the def of
param is an alloca instruction, we know it is non-null and can return early from
LVI. Similarly, CVP queries LVI to check whether pointer for each mem access is
constant. If the def of the pointer is an alloca instruction, we know it is not
a constant pointer. These shortcuts can reduce the cost of CVP significantly.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281586 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Analysis/LazyValueInfo.cpp
test/Transforms/CorrelatedValuePropagation/alloca.ll [new file with mode: 0644]