[all-commits] [llvm/llvm-project] 3610d3: [NFC] Fix quadratic LexicalScopes::constructScopeNest

Jeremy Morse via All-commits all-commits at lists.llvm.org
Mon Jun 8 10:42:09 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 3610d31e7a366da27901313e03089736ec65c91d
      https://github.com/llvm/llvm-project/commit/3610d31e7a366da27901313e03089736ec65c91d
  Author: Jan-Willem Maessen <jmaessen at fb.com>
  Date:   2020-06-08 (Mon, 08 Jun 2020)

  Changed paths:
    M llvm/lib/CodeGen/LexicalScopes.cpp

  Log Message:
  -----------
  [NFC] Fix quadratic LexicalScopes::constructScopeNest

We sometimes have functions with large numbers of sibling basic
blocks (usually with an error path exit from each one). This was
triggering the qudratic behavior in this function - after visiting
each child llvm would re-scan the parent from the beginning again. We
modify the work stack to record the next index to be worked on
alongside the pointer. This avoids the need to linearly search for
the next unfinished child.

Differential Revision: https://reviews.llvm.org/D80029




More information about the All-commits mailing list