[llvm-bugs] [Bug 29064] New: Clang hangs compiling part of Chromium on Mac

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Aug 19 13:24:25 PDT 2016


https://llvm.org/bugs/show_bug.cgi?id=29064

            Bug ID: 29064
           Summary: Clang hangs compiling part of Chromium on Mac
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: hans at chromium.org
                CC: llvm-bugs at lists.llvm.org, rnk at google.com,
                    sebpop at gmail.com
    Classification: Unclassified

Created attachment 17008
  --> https://llvm.org/bugs/attachment.cgi?id=17008&action=edit
repro

Reproduction with the attached source:

$ clang -cc1 -triple x86_64-apple-macosx10.7.0 -emit-obj -mrelocation-model pic
-pic-level 2 -mthread-model posix -mdisable-fp-elim -relaxed-aliasing
-masm-verbose -munwind-tables -target-cpu core2 -target-linker-version 253.3
-dwarf-column-info -debug-info-kind=standalone -dwarf-version=2
-debugger-tuning=lldb -stdlib=libc++ -O2 -std=c++11 -fdeprecated-macro 
-fvisibility hidden -fvisibility-inlines-hidden -stack-protector 1 -fblocks
-fno-rtti -fno-threadsafe-statics -fobjc-runtime=macosx-10.7.0
-fencode-extended-block-signature -fmax-type-align=16 -vectorize-loops
-vectorize-slp -o /dev/null -x c++ /tmp/b.ii


I think this was triggered by a change in libc++: r278356, which added
__always__inline__ on the basic_string<>::__init methods.

The function being compiled,
_Z23PopulateIpcMessageNamesRN10ipc_fuzzer12MessageNamesE is constructing a very
large number of strings, so it might be that this change pushed the compile
time from very slow to glacial by hitting some quadratic algorithm
(MemoryDependenceAnalysis?)


The stack from where clang is spending time looks like this:

#0  InsertIntoBucketImpl<llvm::Instruction const*> (TheBucket=0x1c15a560,
Lookup=@0x7fffffffa870: 0x15a01a18, Key=@0x7fffffffa870: 0x15a01a18,
this=0x7fffffffaed0) at ../include/llvm/ADT/DenseMap.h:487
#1  InsertIntoBucket<llvm::Instruction const* const&> (Key=@0x7fffffffa870:
0x15a01a18, TheBucket=0x1c15a560, this=0x7fffffffaed0) at
../include/llvm/ADT/DenseMap.h:450
#2  FindAndConstruct (Key=@0x7fffffffa870: 0x15a01a18, this=0x7fffffffaed0) at
../include/llvm/ADT/DenseMap.h:267
#3  operator[] (Key=@0x7fffffffa870: 0x15a01a18, this=0x7fffffffaed0) at
../include/llvm/ADT/DenseMap.h:271
#4  llvm::OrderedBasicBlock::comesBefore (this=0x7fffffffaed0, A=0x14ef32a8,
B=0x15a142c8) at ../lib/Analysis/OrderedBasicBlock.cpp:50
#5  0x000000000148ca2c in llvm::OrderedBasicBlock::dominates (this=<optimized
out>, A=<optimized out>, B=B at entry=0x15a142c8) at
../lib/Analysis/OrderedBasicBlock.cpp:84
#6  0x000000000140052e in (anonymous namespace)::CapturesBefore::isSafeToPrune
(this=this at entry=0x7fffffffacd0, I=0x15a142c8) at
../lib/Analysis/CaptureTracking.cpp:90
#7  0x00000000014007b8 in (anonymous namespace)::CapturesBefore::shouldExplore
(this=0x7fffffffacd0, U=<optimized out>) at
../lib/Analysis/CaptureTracking.cpp:124
#8  0x0000000001400abb in llvm::PointerMayBeCaptured (V=V at entry=0x15e37d28,
Tracker=Tracker at entry=0x7fffffffacd0) at
../lib/Analysis/CaptureTracking.cpp:226
#9  0x0000000001401c29 in llvm::PointerMayBeCapturedBefore
(V=V at entry=0x15e37d28, ReturnCaptures=ReturnCaptures at entry=true,
StoreCaptures=StoreCaptures at entry=true, I=I at entry=0x14ef32a8,
DT=DT at entry=0xd5bcfe0, IncludeI=IncludeI at entry=true,
OBB=OBB at entry=0x7fffffffaed0)
    at ../lib/Analysis/CaptureTracking.cpp:202
#10 0x00000000013c80a5 in llvm::AAResults::callCapturesBefore (this=0x1a061c10,
I=I at entry=0x14ef32a8, MemLoc=..., DT=0xd5bcfe0, OBB=OBB at entry=0x7fffffffaed0)
at ../lib/Analysis/AliasAnalysis.cpp:448
#11 0x000000000147e620 in
llvm::MemoryDependenceResults::getSimplePointerDependencyFrom
(this=this at entry=0x17668e70, MemLoc=..., isLoad=isLoad at entry=false, ScanIt=...,
BB=0x14597c70, QueryInst=0x0) at
../lib/Analysis/MemoryDependenceAnalysis.cpp:652
#12 0x000000000147e6af in
llvm::MemoryDependenceResults::getPointerDependencyFrom
(this=this at entry=0x17668e70, MemLoc=..., isLoad=isLoad at entry=false, ScanIt=...,
BB=BB at entry=0x14597c70, QueryInst=QueryInst at entry=0x0) at
../lib/Analysis/MemoryDependenceAnalysis.cpp:341
#13 0x0000000001a48e93 in eliminateDeadStores (BB=..., AA=AA at entry=0x1a061c10,
MD=MD at entry=0x17668e70, DT=DT at entry=0xd5bcfe0, TLI=TLI at entry=0x8297c80) at
../lib/Transforms/Scalar/DeadStoreElimination.cpp:1143
#14 0x0000000001a4a5cd in eliminateDeadStores (F=..., AA=0x1a061c10,
MD=0x17668e70, DT=0xd5bcfe0, TLI=0x8297c80) at
../lib/Transforms/Scalar/DeadStoreElimination.cpp:1166
#15 0x000000000185114b in llvm::FPPassManager::runOnFunction
(this=this at entry=0x14893850, F=...) at ../lib/IR/LegacyPassManager.cpp:1522
#16 0x000000000243e280 in RunPassOnSCC (DevirtualizedCall=<synthetic pointer>,
CallGraphUpToDate=<synthetic pointer>, CG=..., CurSCC=..., P=0x14893850,
this=<optimized out>) at ../lib/Analysis/CallGraphSCCPass.cpp:151
#17 RunAllPassesOnSCC (DevirtualizedCall=<synthetic pointer>, CG=...,
CurSCC=..., this=<optimized out>) at ../lib/Analysis/CallGraphSCCPass.cpp:420
#18 (anonymous namespace)::CGPassManager::runOnModule (this=<optimized out>,
M=...) at ../lib/Analysis/CallGraphSCCPass.cpp:475
#19 0x000000000185181f in runOnModule (M=..., this=<optimized out>) at
../lib/IR/LegacyPassManager.cpp:1599
#20 llvm::legacy::PassManagerImpl::run (this=0x19e80570, M=...) at
../lib/IR/LegacyPassManager.cpp:1702
#21 0x00000000018519d9 in llvm::legacy::PassManager::run
(this=this at entry=0x7fffffffb9c0, M=...) at ../lib/IR/LegacyPassManager.cpp:1733
#22 0x0000000001d17296 in EmitAssembly (OS=..., Action=clang::Backend_EmitObj,
this=0x7fffffffbab0) at ../tools/clang/lib/CodeGen/BackendUtil.cpp:718
#23 clang::EmitBackendOutput (Diags=..., CGOpts=..., TOpts=..., LOpts=...,
TDesc=..., M=0x58b0af0, Action=Action at entry=clang::Backend_EmitObj,
OS=std::unique_ptr<llvm::raw_pwrite_stream> containing 0x0) at
../tools/clang/lib/CodeGen/BackendUtil.cpp:808
#24 0x00000000022f8318 in clang::BackendConsumer::HandleTranslationUnit
(this=0x58b0610, C=...) at ../tools/clang/lib/CodeGen/CodeGenAction.cpp:195
#25 0x000000000261767b in clang::ParseAST (S=..., PrintStats=<optimized out>,
SkipFunctionBodies=<optimized out>) at
../tools/clang/lib/Parse/ParseAST.cpp:167
#26 0x0000000002021dda in clang::ASTFrontendAction::ExecuteAction
(this=this at entry=0x5894f60) at
../tools/clang/lib/Frontend/FrontendAction.cpp:558
#27 0x00000000022f86de in clang::CodeGenAction::ExecuteAction (this=0x5894f60)
at ../tools/clang/lib/CodeGen/CodeGenAction.cpp:867
#28 0x0000000002022a76 in clang::FrontendAction::Execute
(this=this at entry=0x5894f60) at
../tools/clang/lib/Frontend/FrontendAction.cpp:458
#29 0x0000000001ffe69e in clang::CompilerInstance::ExecuteAction
(this=this at entry=0x588f600, Act=...) at
../tools/clang/lib/Frontend/CompilerInstance.cpp:871
#30 0x00000000020a6e94 in clang::ExecuteCompilerInvocation
(Clang=Clang at entry=0x588f600) at
../tools/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp:246
#31 0x0000000000a4f358 in cc1_main (Argv=..., Argv0=Argv0 at entry=0x7fffffffdd02
"/usr/local/google/work/llvm/build.reldebug/bin/clang",
MainAddr=MainAddr at entry=0xa4b960 <GetExecutablePath(char const*, bool)>) at
../tools/clang/tools/driver/cc1_main.cpp:181
#32 0x00000000009faaaf in ExecuteCC1Tool (Tool=..., argv=...) at
../tools/clang/tools/driver/driver.cpp:299
#33 main (argc_=<optimized out>, argv_=<optimized out>) at
../tools/clang/tools/driver/driver.cpp:380

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20160819/3863299c/attachment.html>


More information about the llvm-bugs mailing list