]> granicus.if.org Git - llvm/commit
LazyValueInfo: Actually re-visit partially solved block-values in solveBlockValue()
authorHans Wennborg <hans@hanshq.net>
Tue, 25 Nov 2014 17:23:05 +0000 (17:23 +0000)
committerHans Wennborg <hans@hanshq.net>
Tue, 25 Nov 2014 17:23:05 +0000 (17:23 +0000)
commit4d48c3f1aad9f2fc4bfcb830ddea26a6b269f706
tree80d0d5a44c57cfbb7a73db505a2d89fcfc7967d2
parentf71e0f85cbe1e67e7a42f33c5588b289fff82b41
LazyValueInfo: Actually re-visit partially solved block-values in solveBlockValue()

If solveBlockValue() needs results from predecessors that are not already
computed, it returns false with the intention of resuming when the dependencies
have been resolved. However, the computation would never be resumed since an
'overdefined' result had been placed in the cache, preventing any further
computation.

The point of placing the 'overdefined' result in the cache seems to have been
to break cycles, but we can check for that when inserting work items in the
BlockValue stack instead. This makes the "stop and resume" mechanism of
solveBlockValue() work as intended, unlocking more analysis.

Using this patch shaves 120 KB off a 64-bit Chromium build on Linux.

I benchmarked compiling bzip2.c at -O2 but couldn't measure any difference in
compile time.

Tests by Jiangning Liu from r215343 / PR21238, Pete Cooper, and me.

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

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