[all-commits] [llvm/llvm-project] 198762: [LiveDebugValues] Cache LexicalScopes::getMachineB...

Vedant Kumar via All-commits all-commits at lists.llvm.org
Thu Jun 4 16:59:17 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 198762680e1e66518ee531c9cce5bf1933accea3
      https://github.com/llvm/llvm-project/commit/198762680e1e66518ee531c9cce5bf1933accea3
  Author: Vedant Kumar <vsk at apple.com>
  Date:   2020-06-04 (Thu, 04 Jun 2020)

  Changed paths:
    M llvm/include/llvm/CodeGen/LexicalScopes.h
    M llvm/lib/CodeGen/LexicalScopes.cpp
    M llvm/lib/CodeGen/LiveDebugValues.cpp

  Log Message:
  -----------
  [LiveDebugValues] Cache LexicalScopes::getMachineBasicBlocks, NFCI

Summary:
Cache the results from getMachineBasicBlocks in LexicalScopes to speed
up UserValueScopes::dominates queries.  This replaces the caching done
in UserValueScopes. Compared to the old caching method, this reduces
memory traffic when a VarLoc is copied (e.g. when a VarLocMap grows),
and enables caching across basic blocks.

When compiling sqlite 3.5.7 (CTMark version), this patch reduces the
number of calls to getMachineBasicBlocks from 10,207 to 1,093. I also
measured a small compile-time reduction (~ 0.1% of total wall time, on
average, on my machine).

As a drive-by, I made the DebugLoc in UserValueScopes a const reference
to cut down on MetadataTracking traffic.

Reviewers: jmorse, Orlando, aprantl, nikic

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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




More information about the All-commits mailing list