[all-commits] [llvm/llvm-project] c4861e: [Assignment Tracking] Elide a map copy in some cases

Orlando Cazalet-Hyams via All-commits all-commits at lists.llvm.org
Wed Mar 29 06:26:12 PDT 2023

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c4861e32ed9096e5f737bc938073077ce279dbcc
  Author: OCHyams <orlando.hyams at sony.com>
  Date:   2023-03-29 (Wed, 29 Mar 2023)

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

  Log Message:
  [Assignment Tracking] Elide a map copy in some cases

Restructure AssignmentTrackingLowering::join to avoid a map copy in the case
where BB has more than one pred.

We only need to perform a copy of a pred LiveOut if there's exactly one
already-visited pred (Result = PredLiveOut). With more than one pred the result
is built by calling Result = join(std::move(Result), PredLiveOut) for each
subsequent pred, where join parameters are const &. i.e. with more than 1 pred
we can avoid copying by referencing the first two pred LiveOuts in the first
join and then using a move + reference for the rest.

This reduces compile time for CTMark LTO-O3-g builds.

Reviewed By: jmorse

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

More information about the All-commits mailing list