[all-commits] [llvm/llvm-project] 6bf279: [MachineSSAUpdater] compile time improvement in Ge...

serguei-katkov via All-commits all-commits at lists.llvm.org
Tue Jun 14 04:30:22 PDT 2022

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 6bf27918144cb843cf5ae9a93cb5f936730f3cce
  Author: Serguei Katkov <serguei.katkov at azul.com>
  Date:   2022-06-14 (Tue, 14 Jun 2022)

  Changed paths:
    M llvm/lib/CodeGen/MachineSSAUpdater.cpp
    M llvm/lib/Transforms/Utils/SSAUpdater.cpp

  Log Message:
  [MachineSSAUpdater] compile time improvement in GetValueInMiddleOfBlock

GetValueInMiddleOfBlock uses result of GetValueAtEndOfBlockInternal if there is no value
defined for current basic block.

If there is already a value it tries (in this order):

to find single register coming from all predecessors
find existing phi node which matches our incoming registers
build new phi.
The compile time improvement is to use current available value if
it is defined out of current BB or it is a PHI register.
This is due to it can be used in the middle basic block.

Reviewed By: sameerds
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D126523

More information about the All-commits mailing list