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)
commitf160e345be41a6ec55a0569a330253b72463d73f
treee845ab858cf00eb9d38c02694bb927e3809412a4
parent2857eabcd724e67af306905f5b1675701092b7ae
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

llvm-svn: 281586
llvm/lib/Analysis/LazyValueInfo.cpp
llvm/test/Transforms/CorrelatedValuePropagation/alloca.ll [new file with mode: 0644]