[PATCH] D19002: [LazyValueInfo] Fix for a nasty compile-time problem with questions

Gerolf Hoflehner via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 11 18:54:12 PDT 2016


Gerolf created this revision.
Gerolf added reviewers: hfinkel, reames.
Gerolf added a subscriber: llvm-commits.

In a generated test case the compile does not finish in LVI. It is a big
initializing function with ~150K of code consisting mostly of allocas and
direct/indirect calls. The LVI solver essentially pushes the allocas with
undefined lattice value recursively on the block stack and fails to derive a
value (or bottom). In the bigger picture the core problem is that the value
range problem is not solved as a forward problem with well defined top, bottom,
meet etc. Instead the solver could walk the CFG spontaneously in any
direction and push values on the block stack *while* it tries to determine the meet
for each value. The tactical fix here is to suppress this scheme when
the value is an alloca. In this case the value can be determined to "not null".
This reduces the compile-time to less than 2 minutes.
While looking at the code I also found a few snippets, and for some them ask for
clarication. I marked them as FIXME's. Please chip in when you remember
something about the code.
Longer term I think this pass needs to be rewritten as forward dfa for const
ranges. Currently I don't think one can guarantee that the LVI algorithm
terminates in a reasonable time more compile-time problems lurking.

http://reviews.llvm.org/D19002

Files:
  lib/Analysis/LazyValueInfo.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D19002.53348.patch
Type: text/x-patch
Size: 5404 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160412/8db5a96d/attachment-0001.bin>


More information about the llvm-commits mailing list