[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 18 11:36:08 PDT 2016


Gerolf added a comment.

Who can take a look at this? To illustrate the issue  I added a basic dumper:




- lib/Analysis/LazyValueInfo.cpp	(revision 263867)

+++ lib/Analysis/LazyValueInfo.cpp	(working copy)
@@ -565,10 +565,13 @@
 }

void LazyValueInfoCache::solve() {
+int count=1;

  while (!BlockValueStack.empty()) {
    std::pair<BasicBlock*, Value*> &e = BlockValueStack.top();
    assert(BlockValueSet.count(e) && "Stack value should be in BlockValueSet!");
   

+count++;
+if (count > 10) errs() <<  "POP " << *e.second << " in " << e.first->getName() << " = " << getCachedValueInfo(e.second, e.first) << "\n";

  if (solveBlockValue(e.second, e.first)) {
    // The work item was completely processed.
    assert(BlockValueStack.top() == e && "Nothing should have been pushed!");

After about  *16* hours (and still happily running) it dumps about 500k lines like:

POP   %ref.tmp74111 = alloca i32, align 4 in invoke.cont74104 = undefined
POP   %ref.tmp74111 = alloca i32, align 4 in if.then.i.i.i207266 = undefined
POP   %ref.tmp74111 = alloca i32, align 4 in _ZNSt3__110shared_ptrIN9TlvBuffer10TlvElementEED1Ev.exit207271 = undefined
POP   %ref.tmp74111 = alloca i32, align 4 in invoke.cont74108 = undefined
POP   %ref.tmp74112 = alloca i64, align 8 in invoke.cont74080 = undefined
POP   %ref.tmp74112 = alloca i64, align 8 in invoke.cont74085 = undefined
POP   %ref.tmp74112 = alloca i64, align 8 in if.then.i.i.i207244 = undefined
POP   %ref.tmp74112 = alloca i64, align 8 in _ZNSt3__110shared_ptrIN9TlvBuffer10TlvElementEED1Ev.exit207249 = undefined
POP   %ref.tmp74112 = alloca i64, align 8 in invoke.cont74089 = undefined
POP   %ref.tmp74112 = alloca i64, align 8 in invoke.cont74094 = undefined
POP   %ref.tmp74112 = alloca i64, align 8 in if.then.i.i.i207255 = undefined
POP   %ref.tmp74112 = alloca i64, align 8 in _ZNSt3__110shared_ptrIN9TlvBuffer10TlvElementEED1Ev.exit207260 = undefined
POP   %ref.tmp74112 = alloca i64, align 8 in invoke.cont74098 = undefined
POP   %ref.tmp74112 = alloca i64, align 8 in invoke.cont74104 = undefined
POP   %ref.tmp74112 = alloca i64, align 8 in if.then.i.i.i207266 = undefined
POP   %ref.tmp74112 = alloca i64, align 8 in _ZNSt3__110shared_ptrIN9TlvBuffer10TlvElementEED1Ev.exit207271 = undefined
POP   %ref.tmp74112 = alloca i64, align 8 in invoke.cont74108 = undefined
POP   %ref.tmp74120 = alloca i32, align 4 in invoke.cont74089 = undefined
POP   %ref.tmp74120 = alloca i32, align 4 in invoke.cont74094 = undefined

I think we can make the file exposing this problem part of the compile-time test suite.

The patch offers a conservative fix in the data flow sense.

Thanks
Gerolf


http://reviews.llvm.org/D19002





More information about the llvm-commits mailing list