[all-commits] [llvm/llvm-project] 2c3733: [Transforms] Speed up SSAUpdater::FindExistingPHI ...

William Junda Huang via All-commits all-commits at lists.llvm.org
Mon Jul 29 09:16:07 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 2c37334d8dce7ef7d3ecc8c80522fe73010b12cc
      https://github.com/llvm/llvm-project/commit/2c37334d8dce7ef7d3ecc8c80522fe73010b12cc
  Author: William Junda Huang <williamjhuang at google.com>
  Date:   2024-07-29 (Mon, 29 Jul 2024)

  Changed paths:
    M llvm/include/llvm/Transforms/Utils/SSAUpdaterImpl.h

  Log Message:
  -----------
  [Transforms] Speed up SSAUpdater::FindExistingPHI (#100281)

In SSAUpdater::FindExistingPHI, the cleanup function is inefficient for
large function with many blocks because it clears the Phi value
reference for every block if not matched for every phi value, even if
most blocks are not modified by CheckIfPHIMatches. This behavior is
particularly slow for large functions because the complexity is Θ(# PHI
* # BBs).


Updated the behavior to only clear modified blocks, which in practice
has a much less complexity because of early exit on PHI mismatch.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list