[all-commits] [llvm/llvm-project] 369d08: [MBP] Partial tail duplication into hot predecessors

weiguozhi via All-commits all-commits at lists.llvm.org
Wed Feb 12 15:24:05 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 369d086d784e0c8cc7add9823f319e95f95dbd81
      https://github.com/llvm/llvm-project/commit/369d086d784e0c8cc7add9823f319e95f95dbd81
  Author: Guozhi Wei <carrot at google.com>
  Date:   2020-02-12 (Wed, 12 Feb 2020)

  Changed paths:
    M llvm/include/llvm/CodeGen/TailDuplicator.h
    M llvm/lib/CodeGen/MachineBlockPlacement.cpp
    M llvm/lib/CodeGen/TailDuplicator.cpp
    A llvm/test/CodeGen/X86/partial-tail-dup.ll

  Log Message:
  -----------
  [MBP] Partial tail duplication into hot predecessors

Current tail duplication embedded in MBP duplicates a BB into all or none of its predecessors without too much cost analysis. So sometimes it is duplicated into cold predecessors, and in other cases it may miss the duplication into hot predecessors.

This patch improves tail duplication in 3 aspects:

  A successor can be duplicated into part of its predecessors.
  A more fine-grained benefit analysis, combined with 1, now a successor is duplicated into hot predecessors only.
  If a successor can't be duplicated into one predecessor, it doesn't impact the duplication into other predecessors.

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




More information about the All-commits mailing list