[PATCH] D58995: [CGP] Avoid repeatedly building DominatorTree causing long compile-time (NFC)

Rafael Auler via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 22 10:50:34 PDT 2019


rafauler added a comment.

Hi, do we know whether this patch fully mitigated the issue or if there are still opportunities to improve compile time?  I'm using clang trunk from Wednesday March 20th, and I cannot finish the compilation of a large project with ThinLTO and autofdo profile (compilation time was reasonable before, but ballooned to over 10 hours). When I run perf top to see what is happening, I see that the compiler is most of the time in code dealing with dominator trees or in CodeGenPrepare::runOnFunction. I don't remember seeing this issue before (Clang from February). A snapshot of hottest functions while waiting for the never finishing linking:

   1.43%  [.] (anonymous namespace)::CodeGenPrepare::runOnFunction
   1.38%  [.] llvm::TargetLibraryInfoImpl::getLibFunc
    1.19%  [.] llvm::BasicBlock::getTerminator
   1.13%  [.] llvm::DenseMapBase<llvm::DenseMap<llvm::BasicBlock*, llvm::DomTreeBuilder::SemiNCAInfo<llvm::DominatorTreeBase<llvm::BasicBlock, false> >::InfoRec, llvm::DenseMapInfo<llvm::BasicBlock*>, llvm::detail::DenseMapPair<llvm::BasicBlock*, llvm::DomTreeBuilder::SemiNCAInfo<l
   0.94%  [.] (anonymous namespace)::CodeGenPrepare::optimizeInst
   0.81%  [.] llvm::DomTreeBuilder::SemiNCAInfo<llvm::DominatorTreeBase<llvm::BasicBlock, false> >::attachNewSubtree
   0.65%  [.] (anonymous namespace)::CodeGenPrepare::optimizeCallInst
  0.54%  [.] llvm::Instruction::getSuccessor
   0.51%  [.] llvm::DomTreeBuilder::SemiNCAInfo<llvm::DominatorTreeBase<llvm::BasicBlock, false> >::runDFS<false, bool (*)(llvm::BasicBlock*, llvm::BasicBlock*)>

Just thought about mentioning here in case anyone has ideas, but I'm still figuring out the root cause.


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D58995/new/

https://reviews.llvm.org/D58995





More information about the llvm-commits mailing list