<div dir="ltr">Thank you. So an SCC pass (Inliner in this case) may invalidate the CallGraph iterator held in the loop in CGPassManager::runOnModule by removing a function from the module. This is clearly a bug in this change, reverting.<div><br><div><br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jul 13, 2018 at 9:00 AM, Sumanth Gundapaneni <span dir="ltr"><<a href="mailto:sgundapa@codeaurora.org" target="_blank">sgundapa@codeaurora.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div lang="EN-US" link="blue" vlink="purple"><div><p class="MsoNormal">I was able to reproduce the problem consistently with my ASAN build. <u></u><u></u></p><p class="MsoNormal">I cannot share the source code but I can share the crash log.<u></u><u></u></p><p class="MsoNormal">It is a “heap-use-after-free” that comes from debug statement (#ifndef NDEBUG).<u></u><u></u></p><p class="MsoNormal">Hopefully this helps.<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">--Sumanth<u></u><u></u></p><p class="MsoNormal"><b>From:</b> llvm-commits [mailto:<a href="mailto:llvm-commits-bounces@lists.llvm.org" target="_blank">llvm-commits-bounces@<wbr>lists.llvm.org</a>] <b>On Behalf Of </b>Evgenii Stepanov via llvm-commits<br><b>Sent:</b> Friday, July 13, 2018 10:24 AM<br><b>To:</b> Galina Kistanova <<a href="mailto:gkistanova@gmail.com" target="_blank">gkistanova@gmail.com</a>><br><b>Cc:</b> LLVM Commits <<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>><br><b>Subject:</b> Re: [llvm] r336419 - CallGraphSCCPass: iterate over all functions.<u></u><u></u></p><div><div class="h5"><p class="MsoNormal"><u></u> <u></u></p><div><p class="MsoNormal">MSan buildbot crashes are still happening, once per 8 builds or so. I can't reproduce them locally and am not 100% sure that this is the change, but, given the nondeterminism detected on the other bot, I'm going to tentatively revert it.<u></u><u></u></p><div><p class="MsoNormal"><u></u> <u></u></p></div></div><div><p class="MsoNormal"><u></u> <u></u></p><div><p class="MsoNormal">On Thu, Jul 12, 2018 at 12:01 PM, Galina Kistanova <<a href="mailto:gkistanova@gmail.com" target="_blank">gkistanova@gmail.com</a>> wrote:<u></u><u></u></p><blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in"><div><div><p class="MsoNormal">Hello Tim,<u></u><u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">This commit has introduced nondeterminism. Please see <a href="http://lab.llvm.org:8011/builders/clang-with-thin-lto-ubuntu" target="_blank">http://lab.llvm.org:8011/<wbr>builders/clang-with-thin-lto-<wbr>ubuntu</a> or <a href="http://lab.llvm.org:8011/builders/clang-with-lto-ubuntu" target="_blank">http://lab.llvm.org:8011/<wbr>builders/clang-with-lto-ubuntu</a> build bots.<u></u><u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">This is in addition to those other problems mentioned already, or maybe some of the other problems are exposed because of this.<u></u><u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">Since the problem is around for quite long now, maybe it worth reverting till you will figure out what's wrong and how to fix it?<u></u><u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">Thanks<u></u><u></u></p></div><div><p class="MsoNormal"><span style="color:#888888"><u></u> <u></u></span></p></div><div><p class="MsoNormal"><span style="color:#888888">Galina<u></u><u></u></span></p></div><div><p class="MsoNormal"><span style="color:#888888"><u></u> <u></u></span></p></div><div><p class="MsoNormal"><span style="color:#888888"><u></u> <u></u></span></p></div><div><p class="MsoNormal"><span style="color:#888888"><u></u> <u></u></span></p></div></div><div><div><div><p class="MsoNormal"><u></u> <u></u></p><div><p class="MsoNormal">On Tue, Jul 10, 2018 at 1:33 PM, Evgenii Stepanov via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>> wrote:<u></u><u></u></p><blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in"><div><div><p class="MsoNormal">Hi Tim,<u></u><u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">MSan bootstrap bot has been randomly crashing lately with the following trace:<u></u><u></u></p></div><div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">3. Running pass 'CallGraph Pass Manager' on module '/b/sanitizer-x86_64-linux-<wbr>bootstrap-msan/build/llvm/lib/<wbr>Target/Hexagon/<wbr>HexagonCommonGEP.cpp'.<u></u><u></u></p></div><div><p class="MsoNormal">#0 0x00005602f79f5cfa llvm::sys::PrintStackTrace(<wbr>llvm::raw_ostream&) (/b/sanitizer-x86_64-linux-<wbr>bootstrap-msan/build/llvm_<wbr>build0/bin/clang-7+0x24f5cfa)<u></u><u></u></p></div><div><p class="MsoNormal">#1 0x00005602f79f42c5 llvm::sys::RunSignalHandlers() (/b/sanitizer-x86_64-linux-<wbr>bootstrap-msan/build/llvm_<wbr>build0/bin/clang-7+0x24f42c5)<u></u><u></u></p></div><div><p class="MsoNormal">#2 0x00005602f79f43dc SignalHandler(int) (/b/sanitizer-x86_64-linux-<wbr>bootstrap-msan/build/llvm_<wbr>build0/bin/clang-7+0x24f43dc)<u></u><u></u></p></div><div><p class="MsoNormal">#3 0x00007f63daa840c0 __restore_rt (/lib/x86_64-linux-gnu/<wbr>libpthread.so.0+0x110c0)<u></u><u></u></p></div><div><p class="MsoNormal">#4 0x00005602f6edf38e llvm::scc_iterator<llvm::<wbr>CallGraph*, llvm::GraphTraits<llvm::<wbr>CallGraph*> >::DFSVisitChildren() (/b/sanitizer-x86_64-linux-<wbr>bootstrap-msan/build/llvm_<wbr>build0/bin/clang-7+0x19df38e)<u></u><u></u></p></div><div><p class="MsoNormal">#5 0x00005602f6edf5aa llvm::scc_iterator<llvm::<wbr>CallGraph*, llvm::GraphTraits<llvm::<wbr>CallGraph*> >::GetNextSCC() (/b/sanitizer-x86_64-linux-<wbr>bootstrap-msan/build/llvm_<wbr>build0/bin/clang-7+0x19df5aa)<u></u><u></u></p></div><div><p class="MsoNormal">#6 0x00005602f6ee05ed (anonymous namespace)::CGPassManager::<wbr>runOnModule(llvm::Module&) (/b/sanitizer-x86_64-linux-<wbr>bootstrap-msan/build/llvm_<wbr>build0/bin/clang-7+0x19e05ed)<u></u><u></u></p></div><div><p class="MsoNormal">#7 0x00005602f74ca5fd llvm::legacy::PassManagerImpl:<wbr>:run(llvm::Module&) (/b/sanitizer-x86_64-linux-<wbr>bootstrap-msan/build/llvm_<wbr>build0/bin/clang-7+0x1fca5fd)<u></u><u></u></p></div><div><p class="MsoNormal">#8 0x00005602f7bde5c1 (anonymous namespace)::<wbr>EmitAssemblyHelper::<wbr>EmitAssembly(clang::<wbr>BackendAction, std::unique_ptr<llvm::raw_<wbr>pwrite_stream, std::default_delete<llvm::raw_<wbr>pwrite_stream> >) (/b/sanitizer-x86_64-linux-<wbr>bootstrap-msan/build/llvm_<wbr>build0/bin/clang-7+0x26de5c1)<u></u><u></u></p></div><div><p class="MsoNormal">#9 0x00005602f7bdfdf0 clang::EmitBackendOutput(<wbr>clang::DiagnosticsEngine&, clang::HeaderSearchOptions const&, clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions const&, llvm::DataLayout const&, llvm::Module*, clang::BackendAction, std::unique_ptr<llvm::raw_<wbr>pwrite_stream, std::default_delete<llvm::raw_<wbr>pwrite_stream> >) (/b/sanitizer-x86_64-linux-<wbr>bootstrap-msan/build/llvm_<wbr>build0/bin/clang-7+0x26dfdf0)<u></u><u></u></p></div><div><p class="MsoNormal">#10 0x00005602f836f264 clang::BackendConsumer::<wbr>HandleTranslationUnit(clang::<wbr>ASTContext&) (/b/sanitizer-x86_64-linux-<wbr>bootstrap-msan/build/llvm_<wbr>build0/bin/clang-7+0x2e6f264)<u></u><u></u></p></div><div><p class="MsoNormal">#11 0x00005602f8b37fa9 clang::ParseAST(clang::Sema&, bool, bool) (/b/sanitizer-x86_64-linux-<wbr>bootstrap-msan/build/llvm_<wbr>build0/bin/clang-7+0x3637fa9)<u></u><u></u></p></div><div><p class="MsoNormal">#12 0x00005602f836e4d9 clang::CodeGenAction::<wbr>ExecuteAction() (/b/sanitizer-x86_64-linux-<wbr>bootstrap-msan/build/llvm_<wbr>build0/bin/clang-7+0x2e6e4d9)<u></u><u></u></p></div><div><p class="MsoNormal">#13 0x00005602f800da7e clang::FrontendAction::<wbr>Execute() (/b/sanitizer-x86_64-linux-<wbr>bootstrap-msan/build/llvm_<wbr>build0/bin/clang-7+0x2b0da7e)<u></u><u></u></p></div><div><p class="MsoNormal">#14 0x00005602f7fd9496 clang::CompilerInstance::<wbr>ExecuteAction(clang::<wbr>FrontendAction&) (/b/sanitizer-x86_64-linux-<wbr>bootstrap-msan/build/llvm_<wbr>build0/bin/clang-7+0x2ad9496)<u></u><u></u></p></div><div><p class="MsoNormal">#15 0x00005602f80ad511 clang::<wbr>ExecuteCompilerInvocation(<wbr>clang::CompilerInstance*) (/b/sanitizer-x86_64-linux-<wbr>bootstrap-msan/build/llvm_<wbr>build0/bin/clang-7+0x2bad511)<u></u><u></u></p></div><div><p class="MsoNormal">#16 0x00005602f614c080 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/b/sanitizer-x86_64-linux-<wbr>bootstrap-msan/build/llvm_<wbr>build0/bin/clang-7+0xc4c080)<u></u><u></u></p></div><div><p class="MsoNormal">#17 0x00005602f60c1a22 main (/b/sanitizer-x86_64-linux-<wbr>bootstrap-msan/build/llvm_<wbr>build0/bin/clang-7+0xbc1a22)<u></u><u></u></p></div><div><p class="MsoNormal">#18 0x00007f63d98312e1 __libc_start_main (/lib/x86_64-linux-gnu/libc.<wbr>so.6+0x202e1)<u></u><u></u></p></div><div><p class="MsoNormal">#19 0x00005602f61480aa _start (/b/sanitizer-x86_64-linux-<wbr>bootstrap-msan/build/llvm_<wbr>build0/bin/clang-7+0xc480aa)<u></u><u></u></p></div><div><p class="MsoNormal">clang-7: error: unable to execute command: Segmentation fault<u></u><u></u></p></div></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">The crash happens roughly in 1 out of 5-to-10 builds, see history here:<u></u><u></u></p></div><p class="MsoNormal"><a href="http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-bootstrap-msan?numbuilds=300" target="_blank">http://lab.llvm.org:8011/<wbr>builders/sanitizer-x86_64-<wbr>linux-bootstrap-msan?<wbr>numbuilds=300</a><u></u><u></u></p><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">The earliest it happened was this build at r336432:<u></u><u></u></p></div><div><p class="MsoNormal"><a href="http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-bootstrap-msan/builds/5763" target="_blank">http://lab.llvm.org:8011/<wbr>builders/sanitizer-x86_64-<wbr>linux-bootstrap-msan/builds/<wbr>5763</a><u></u><u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">I suspect that this change could be the culprit. Could you take a look?<u></u><u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div></div><div><div><div><p class="MsoNormal"><u></u> <u></u></p><div><p class="MsoNormal">On Fri, Jul 6, 2018 at 1:04 AM, Tim Northover via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>> wrote:<u></u><u></u></p><blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in"><p class="MsoNormal">Author: tnorthover<br>Date: Fri Jul  6 01:04:47 2018<br>New Revision: 336419<br><br>URL: <a href="http://llvm.org/viewvc/llvm-project?rev=336419&view=rev" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project?rev=336419&view=rev</a><br>Log:<br>CallGraphSCCPass: iterate over all functions.<br><br>Previously we only iterated over functions reachable from the set of<br>external functions in the module. But since some of the passes under<br>this (notably the always-inliner and coroutine lowerer) are required for<br>correctness, they need to run over everything.<br><br>This just adds an extra layer of iteration over the CallGraph to keep<br>track of which functions we've already visited and get the next batch of<br>SCCs.<br><br>Should fix PR38029.<br><br>Modified:<br>    llvm/trunk/include/llvm/ADT/<wbr>SCCIterator.h<br>    llvm/trunk/lib/Analysis/<wbr>CallGraphSCCPass.cpp<br>    llvm/trunk/test/Transforms/<wbr>Inline/always-inline.ll<br><br>Modified: llvm/trunk/include/llvm/ADT/<wbr>SCCIterator.h<br>URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/SCCIterator.h?rev=336419&r1=336418&r2=336419&view=diff" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/llvm/trunk/include/<wbr>llvm/ADT/SCCIterator.h?rev=<wbr>336419&r1=336418&r2=336419&<wbr>view=diff</a><br>==============================<wbr>==============================<wbr>==================<br>--- llvm/trunk/include/llvm/ADT/<wbr>SCCIterator.h (original)<br>+++ llvm/trunk/include/llvm/ADT/<wbr>SCCIterator.h Fri Jul  6 01:04:47 2018<br>@@ -90,6 +90,7 @@ class scc_iterator : public iterator_fac<br>   /// Compute the next SCC using the DFS traversal.<br>   void GetNextSCC();<br><br>+public:<br>   scc_iterator(NodeRef entryN) : visitNum(0) {<br>     DFSVisitOne(entryN);<br>     GetNextSCC();<br>@@ -98,12 +99,6 @@ class scc_iterator : public iterator_fac<br>   /// End is when the DFS stack is empty.<br>   scc_iterator() = default;<br><br>-public:<br>-  static scc_iterator begin(const GraphT &G) {<br>-    return scc_iterator(GT::getEntryNode(<wbr>G));<br>-  }<br>-  static scc_iterator end(const GraphT &) { return scc_iterator(); }<br>-<br>   /// Direct loop termination test which is more efficient than<br>   /// comparison with \c end().<br>   bool isAtEnd() const {<br>@@ -222,16 +217,25 @@ bool scc_iterator<GraphT, GT>::hasLoop()<br>     return false;<br>   }<br><br>-/// Construct the begin iterator for a deduced graph type T.<br>+/// Construct the begin iterator for a deduced graph type T, starting from its<br>+/// entry node.<br> template <class T> scc_iterator<T> scc_begin(const T &G) {<br>-  return scc_iterator<T>::begin(G);<br>+  return scc_iterator<T>(GraphTraits<T><wbr>::getEntryNode(G));<br> }<br><br>-/// Construct the end iterator for a deduced graph type T.<br>+/// Construct the begin iterator for a graph type T, starting from the specified<br>+/// node.<br>+template <class T, class U = GraphTraits<T>><br>+scc_iterator<T, U> scc_begin(typename U::NodeRef N) {<br>+  return scc_iterator<T>(N);<br>+}<br>+<br>+  /// Construct the end iterator for a deduced graph type T.<br> template <class T> scc_iterator<T> scc_end(const T &G) {<br>-  return scc_iterator<T>::end(G);<br>+  return scc_iterator<T>();<br> }<br><br>+<br> } // end namespace llvm<br><br> #endif // LLVM_ADT_SCCITERATOR_H<br><br>Modified: llvm/trunk/lib/Analysis/<wbr>CallGraphSCCPass.cpp<br>URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/CallGraphSCCPass.cpp?rev=336419&r1=336418&r2=336419&view=diff" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/llvm/trunk/lib/<wbr>Analysis/CallGraphSCCPass.cpp?<wbr>rev=336419&r1=336418&r2=<wbr>336419&view=diff</a><br>==============================<wbr>==============================<wbr>==================<br>--- llvm/trunk/lib/Analysis/<wbr>CallGraphSCCPass.cpp (original)<br>+++ llvm/trunk/lib/Analysis/<wbr>CallGraphSCCPass.cpp Fri Jul  6 01:04:47 2018<br>@@ -17,6 +17,7 @@<br><br> #include "llvm/Analysis/<wbr>CallGraphSCCPass.h"<br> #include "llvm/ADT/DenseMap.h"<br>+#include "llvm/ADT/DenseSet.h"<br> #include "llvm/ADT/SCCIterator.h"<br> #include "llvm/ADT/Statistic.h"<br> #include "llvm/Analysis/CallGraph.h"<br>@@ -63,6 +64,10 @@ public:<br>   /// whether any of the passes modifies the module, and if so, return true.<br>   bool runOnModule(Module &M) override;<br><br>+  /// Execute all of the passes scheduled for execution on a given SCC. Return<br>+  /// true if any passes modify the module.<br>+  bool runOnSCC(CallGraphSCC &SCC, CallGraph &CG);<br>+<br>   using ModulePass::doInitialization;<br>   using ModulePass::doFinalization;<br><br>@@ -448,51 +453,78 @@ bool CGPassManager::<wbr>RunAllPassesOnSCC(Ca<br> bool CGPassManager::runOnModule(<wbr>Module &M) {<br>   CallGraph &CG = getAnalysis<<wbr>CallGraphWrapperPass>().<wbr>getCallGraph();<br>   bool Changed = doInitialization(CG);<br>-  <br>-  // Walk the callgraph in bottom-up SCC order.<br>-  scc_iterator<CallGraph*> CGI = scc_begin(&CG);<br><br>-  CallGraphSCC CurSCC(CG, &CGI);<br>-  while (!CGI.isAtEnd()) {<br>-    // Copy the current SCC and increment past it so that the pass can hack<br>-    // on the SCC if it wants to without invalidating our iterator.<br>-    const std::vector<CallGraphNode *> &NodeVec = *CGI;<br>-    CurSCC.initialize(NodeVec);<br>-    ++CGI;<br>-<br>-    // At the top level, we run all the passes in this pass manager on the<br>-    // functions in this SCC.  However, we support iterative compilation in the<br>-    // case where a function pass devirtualizes a call to a function.  For<br>-    // example, it is very common for a function pass (often GVN or instcombine)<br>-    // to eliminate the addressing that feeds into a call.  With that improved<br>-    // information, we would like the call to be an inline candidate, infer<br>-    // mod-ref information etc.<br>-    //<br>-    // Because of this, we allow iteration up to a specified iteration count.<br>-    // This only happens in the case of a devirtualized call, so we only burn<br>-    // compile time in the case that we're making progress.  We also have a hard<br>-    // iteration count limit in case there is crazy code.<br>-    unsigned Iteration = 0;<br>-    bool DevirtualizedCall = false;<br>-    do {<br>-      LLVM_DEBUG(if (Iteration) dbgs()<br>-                 << "  SCCPASSMGR: Re-visiting SCC, iteration #" << Iteration<br>-                 << '\n');<br>-      DevirtualizedCall = false;<br>-      Changed |= RunAllPassesOnSCC(CurSCC, CG, DevirtualizedCall);<br>-    } while (Iteration++ < MaxIterations && DevirtualizedCall);<br>-    <br>-    if (DevirtualizedCall)<br>-      LLVM_DEBUG(dbgs() << "  CGSCCPASSMGR: Stopped iteration after "<br>-                        << Iteration<br>-                        << " times, due to -max-cg-scc-iterations\n");<br>+  DenseSet<const Function *> Visited;<br><br>-    MaxSCCIterations.updateMax(<wbr>Iteration);<br>+  CallGraph::iterator INext;<br>+  for (auto I = CG.begin(), E = CG.end(); I != E;) {<br>+    // Walk the callgraph in bottom-up SCC order.<br>+    auto CGI = scc_begin<CallGraph *>(I->second.get());<br>+<br>+    CallGraphSCC CurSCC(CG, &CGI);<br>+    while (!CGI.isAtEnd()) {<br>+      const std::vector<CallGraphNode *> &NodeVec = *CGI;<br>+<br>+      // Record that we've seen this set of functions so we don't run the pass<br>+      // twice.<br>+      for (auto *Elt : NodeVec)<br>+        Visited.insert(Elt-><wbr>getFunction());<br>+<br>+      // Copy the current SCC and increment past it so that the pass can hack<br>+      // on the SCC if it wants to without invalidating our iterator.<br>+      CurSCC.initialize(NodeVec);<br>+      ++CGI;<br>+<br>+      // If we've got all functions reachable from our chosen initial node,<br>+      // calculate the next node we need to search from now before parts of the<br>+      // graph are invalidated.<br>+      if (CGI.isAtEnd()) {<br>+        do<br>+          ++I;<br>+        while (I != E && Visited.count(I->first));<br>+      }<br>+<br>+      Changed |= runOnSCC(CurSCC, CG);<br>+    }<br>   }<br>+<br>   Changed |= doFinalization(CG);<br>   return Changed;<br> }<br><br>+bool CGPassManager::runOnSCC(<wbr>CallGraphSCC &CurSCC, CallGraph &CG) {<br>+  bool Changed = false;<br>+<br>+  // At the top level, we run all the passes in this pass manager on the<br>+  // functions in this SCC.  However, we support iterative compilation in the<br>+  // case where a function pass devirtualizes a call to a function.  For<br>+  // example, it is very common for a function pass (often GVN or instcombine)<br>+  // to eliminate the addressing that feeds into a call.  With that improved<br>+  // information, we would like the call to be an inline candidate, infer<br>+  // mod-ref information etc.<br>+  //<br>+  // Because of this, we allow iteration up to a specified iteration count.<br>+  // This only happens in the case of a devirtualized call, so we only burn<br>+  // compile time in the case that we're making progress.  We also have a hard<br>+  // iteration count limit in case there is crazy code.<br>+  unsigned Iteration = 0;<br>+  bool DevirtualizedCall = false;<br>+  do {<br>+    LLVM_DEBUG(if (Iteration) dbgs()<br>+               << "  SCCPASSMGR: Re-visiting SCC, iteration #" << Iteration<br>+               << '\n');<br>+    DevirtualizedCall = false;<br>+    Changed |= RunAllPassesOnSCC(CurSCC, CG, DevirtualizedCall);<br>+  } while (Iteration++ < MaxIterations && DevirtualizedCall);<br>+<br>+  if (DevirtualizedCall)<br>+    LLVM_DEBUG(dbgs() << "  CGSCCPASSMGR: Stopped iteration after " << Iteration<br>+                      << " times, due to -max-cg-scc-iterations\n");<br>+<br>+  MaxSCCIterations.updateMax(<wbr>Iteration);<br>+  return Changed;<br>+}<br>+<br> /// Initialize CG<br> bool CGPassManager::<wbr>doInitialization(CallGraph &CG) {<br>   bool Changed = false;<br><br>Modified: llvm/trunk/test/Transforms/<wbr>Inline/always-inline.ll<br>URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/Inline/always-inline.ll?rev=336419&r1=336418&r2=336419&view=diff" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/llvm/trunk/test/<wbr>Transforms/Inline/always-<wbr>inline.ll?rev=336419&r1=<wbr>336418&r2=336419&view=diff</a><br>==============================<wbr>==============================<wbr>==================<br>--- llvm/trunk/test/Transforms/<wbr>Inline/always-inline.ll (original)<br>+++ llvm/trunk/test/Transforms/<wbr>Inline/always-inline.ll Fri Jul  6 01:04:47 2018<br>@@ -316,3 +316,10 @@ define void @outer14() {<br>   call void @inner14()<br>   ret void<br> }<br>+<br>+define internal i32 @outer15() {<br>+; CHECK-LABEL: @outer15<br>+; CHECK: ret i32 1<br>+  %res = call i32 @inner1()<br>+  ret i32 %res<br>+}<br><br><br>______________________________<wbr>_________________<br>llvm-commits mailing list<br><a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a><br><a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-commits</a><u></u><u></u></p></blockquote></div><p class="MsoNormal"><u></u> <u></u></p></div></div></div><p class="MsoNormal" style="margin-bottom:12.0pt"><br>______________________________<wbr>_________________<br>llvm-commits mailing list<br><a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a><br><a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-commits</a><u></u><u></u></p></blockquote></div><p class="MsoNormal"><u></u> <u></u></p></div></div></div></blockquote></div><p class="MsoNormal"><u></u> <u></u></p></div></div></div></div></div></blockquote></div><br></div>