<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hi Chandler,<div class=""><br class=""></div><div class="">We observed some regressions in our regular testing (despite I saw nothing suspicious in my runs). I did accurate investigation and was able to reproduce and track down the regression.</div><div class="">I found the exact request to GlobalsModRef that results in the performance loss (I added a limit on number of requests into the implementation and bisected the number to find the interesting request).</div><div class=""><br class=""></div><div class="">Here are the details:</div><div class=""><br class=""></div><div class="">We’re checking following two locations:</div><div class=""><div class=""><br class=""></div><div class=""><font face="Menlo" size="1" class="">(lldb) p ((llvm::Instruction*)(LocA.Ptr))->dump()</font></div><div class=""><font face="Menlo" size="1" class="">  %arrayidx.i = getelementptr inbounds [1 x %struct.elt_list*], [1 x %struct.elt_list*]* %te.i, i64 0, i64 %indvars.iv.i</font></div></div><div class=""><div class=""><font face="Menlo" size="1" class="">(lldb) p ((llvm::Instruction*)(LocB.Ptr))->dump()</font></div><div class=""><font face="Menlo" size="1" class="">@reg_values = internal unnamed_addr global %struct.varray_head_tag* null, align 8</font></div></div><div class=""><br class=""></div><div class="">and the function in question is “cselib_init”:</div><div class=""><font size="1" face="Menlo" class="">(lldb) p ((llvm::Instruction*)(LocA.Ptr))->getParent()->getParent()->getName()</font></div><div class=""><font size="1" face="Menlo" class="">(llvm::StringRef) $3 = (Data = "cselib_init", Length = 11)</font></div><div class=""><br class=""></div><div class="">Corresponding underlying values:</div><div class=""><div class=""><font face="Menlo" size="1" class="">(lldb) p UV2->dump()</font></div><div class=""><font face="Menlo" size="1" class="">@reg_values = internal unnamed_addr global %struct.varray_head_tag* null, align 8</font></div><div class=""><font face="Menlo" size="1" class="">(lldb) p UV1->dump()</font></div><div class=""><font face="Menlo" size="1" class="">%32 = load %struct.varray_head_tag*, %struct.varray_head_tag** @reg_values, align 8, !tbaa !2</font></div></div><div class=""><br class=""></div><div class="">Backtrace:</div><div class=""><div class=""><font size="1" face="Menlo" class="">(lldb) bt                                                                                                                                                                                                                                                                                        </font><span style="font-family: Menlo; font-size: x-small;" class="">* thread #1: tid = 0x120baaf, 0x00000001038b752a libLTO.dylib`(anonymous namespace)::GlobalsModRef::alias(this=0x000000010eba5c10, LocA=0x00007fff5fbf4198, LocB=0x00007fff5fbf6268) + 570 at GlobalsModRef.cpp:519, queue = 'com.apple.main-thread', stop reason = step over</span></div><div class=""><font size="1" face="Menlo" class="">  * frame #0: 0x00000001038b752a libLTO.dylib`(anonymous namespace)::GlobalsModRef::alias(this=0x000000010eba5c10, LocA=0x00007fff5fbf4198, LocB=0x00007fff5fbf6268) + 570 at GlobalsModRef.cpp:519</font></div><div class=""><font size="1" face="Menlo" class="">    frame #1: 0x00000001038b82f7 libLTO.dylib`non-virtual thunk to (anonymous namespace)::GlobalsModRef::alias(this=0x000000010eba5c30, LocA=0x00007fff5fbf4198, LocB=0x00007fff5fbf6268) + 55 at GlobalsModRef.cpp:562</font></div><div class=""><font size="1" face="Menlo" class="">    frame #2: 0x00000001038d6aa8 libLTO.dylib`llvm::AliasAnalysis::getModRefInfo(this=0x000000010eba5c30, S=0x000000010a1a22e0, Loc=0x00007fff5fbf6268) + 120 at AliasAnalysis.cpp:288</font></div><div class=""><font size="1" face="Menlo" class="">    frame #3: 0x0000000103a0a814 libLTO.dylib`llvm::MemoryDependenceAnalysis::getPointerDependencyFrom(this=0x000000010e6cf0c0, MemLoc=0x00007fff5fbf6268, isLoad=true, ScanIt=llvm::BasicBlock::iterator at 0x00007fff5fbf4390, BB=0x000000010a19ffa0, QueryInst=0x000000010a1a20c8) + 1908 at MemoryDependenceAnalysis.cpp:570</font></div><div class=""><font size="1" face="Menlo" class="">    frame #4: 0x0000000103a0ffa5 libLTO.dylib`llvm::MemoryDependenceAnalysis::GetNonLocalInfoForBlock(this=0x000000010e6cf0c0, QueryInst=0x000000010a1a20c8, Loc=0x00007fff5fbf6268, isLoad=true, BB=0x000000010a19ffa0, Cache=0x0000000100f9d568, NumSortedEntries=0) + 2165 at MemoryDependenceAnalysis.cpp:965</font></div><div class=""><font size="1" face="Menlo" class="">    frame #5: 0x0000000103a0e3a9 libLTO.dylib`llvm::MemoryDependenceAnalysis::getNonLocalPointerDepFromBB(this=0x000000010e6cf0c0, QueryInst=0x000000010a1a20c8, Pointer=0x00007fff5fbf62a8, Loc=0x00007fff5fbf6268, isLoad=true, StartBB=0x000000010a19ffa0, Result=0x00007fff5fbf6bf0, Visited=0x00007fff5fbf6208, SkipFirstBlock=false) + 5897 at MemoryDependenceAnalysis.cpp:1200</font></div><div class=""><font size="1" face="Menlo" class="">    frame #6: 0x0000000103a0cb3b libLTO.dylib`llvm::MemoryDependenceAnalysis::getNonLocalPointerDependency(this=0x000000010e6cf0c0, QueryInst=0x000000010a1a20c8, Result=0x00007fff5fbf6bf0) + 635 at MemoryDependenceAnalysis.cpp:911</font></div><div class=""><font size="1" face="Menlo" class="">    frame #7: 0x000000010340c5b5 libLTO.dylib`(anonymous namespace)::GVN::processNonLocalLoad(this=0x000000010e6ce680, LI=0x000000010a1a20c8) + 101 at GVN.cpp:1706</font></div><div class=""><font size="1" face="Menlo" class="">    frame #8: 0x0000000103408eef libLTO.dylib`(anonymous namespace)::GVN::processLoad(this=0x000000010e6ce680, L=0x000000010a1a20c8) + 1551 at GVN.cpp:1905</font></div><div class=""><font size="1" face="Menlo" class="">    frame #9: 0x00000001034080fd libLTO.dylib`(anonymous namespace)::GVN::processInstruction(this=0x000000010e6ce680, I=0x000000010a1a20c8) + 397 at GVN.cpp:2220</font></div><div class=""><font size="1" face="Menlo" class="">    frame #10: 0x0000000103407d1b libLTO.dylib`(anonymous namespace)::GVN::processBlock(this=0x000000010e6ce680, BB=0x000000010a19ffa0) + 251 at GVN.cpp:2394</font></div><div class=""><font size="1" face="Menlo" class="">    frame #11: 0x0000000103401755 libLTO.dylib`(anonymous namespace)::GVN::iterateOnFunction(this=0x000000010e6ce680, F=0x00000001085f69f8) + 1541 at GVN.cpp:2677</font></div><div class=""><font size="1" face="Menlo" class="">    frame #12: 0x0000000103400fef libLTO.dylib`(anonymous namespace)::GVN::runOnFunction(this=0x000000010e6ce680, F=0x00000001085f69f8) + 623 at GVN.cpp:2352</font></div><div class=""><font size="1" face="Menlo" class="">    frame #13: 0x00000001027cd05b libLTO.dylib`llvm::FPPassManager::runOnFunction(this=0x000000010eba6810, F=0x00000001085f69f8) + 427 at LegacyPassManager.cpp:1520</font></div><div class=""><font size="1" face="Menlo" class="">    frame #14: 0x00000001027cd375 libLTO.dylib`llvm::FPPassManager::runOnModule(this=0x000000010eba6810, M=0x000000010115c5f0) + 117 at LegacyPassManager.cpp:1540</font></div><div class=""><font size="1" face="Menlo" class="">    frame #15: 0x00000001027cdda1 libLTO.dylib`(anonymous namespace)::MPPassManager::runOnModule(this=0x000000010e6cbaf0, M=0x000000010115c5f0) + 1409 at LegacyPassManager.cpp:1596</font></div><div class=""><font size="1" face="Menlo" class="">    frame #16: 0x00000001027cd636 libLTO.dylib`llvm::legacy::PassManagerImpl::run(this=0x000000010e6cb740, M=0x000000010115c5f0) + 310 at LegacyPassManager.cpp:1698</font></div><div class=""><font size="1" face="Menlo" class="">    frame #17: 0x00000001027ce521 libLTO.dylib`llvm::legacy::PassManager::run(this=0x00007fff5fbf82b8, M=0x000000010115c5f0) + 33 at LegacyPassManager.cpp:1729</font></div></div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">The function body is in the attached file.</div><div class=""><br class=""></div><div class=""></div></body></html>