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

Teresa Johnson via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 22 10:55:56 PDT 2019


On Fri, Mar 22, 2019 at 10:50 AM Rafael Auler via Phabricator
<reviews at reviews.llvm.org> wrote:
>
> 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?

See D59696 from this morning =)

I am still debugging the other cause of the compile time regression
mentioned in that patch description.

> 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
>
>
>


--
Teresa Johnson | Software Engineer | tejohnson at google.com |


More information about the llvm-commits mailing list