[all-commits] [llvm/llvm-project] 03bce0: [GlobalISel][Localizer] Don't localize phi operand...

AE via All-commits all-commits at lists.llvm.org
Mon Jan 25 17:52:31 PST 2021

  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 03bce0bf4e3708baa6f2fd7007d79b739f067ddc
  Author: Amara Emerson <amara at apple.com>
  Date:   2021-01-25 (Mon, 25 Jan 2021)

  Changed paths:
    M llvm/include/llvm/CodeGen/GlobalISel/Localizer.h
    M llvm/lib/CodeGen/GlobalISel/Localizer.cpp
    M llvm/test/CodeGen/AArch64/GlobalISel/localizer.mir

  Log Message:
  [GlobalISel][Localizer] Don't localize phi operands which are used more than once in the phi.

The current algorithm just tries to localize defs as far as they can go, and in
the case of G_PHI operands, it clones the def into the predecessor block for
each incoming edge. When multiple edges have the same register value, this can
cause unnecessary code bloat, and inhibit later optimizations.

This change checks if a given phi operand is unique in the phi, if not the
def of that register is not localized to the predecessor.

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

More information about the All-commits mailing list