[all-commits] [llvm/llvm-project] 078d21: [TailDup] Delay aggressive computed-goto taildup t...

Florian Hahn via All-commits all-commits at lists.llvm.org
Thu Jul 31 11:20:27 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 078d214672e23691566137fa88b851c7022666b7
      https://github.com/llvm/llvm-project/commit/078d214672e23691566137fa88b851c7022666b7
  Author: Florian Hahn <flo at fhahn.com>
  Date:   2025-07-31 (Thu, 31 Jul 2025)

  Changed paths:
    M llvm/lib/CodeGen/TailDuplicator.cpp
    M llvm/test/CodeGen/AArch64/late-taildup-computed-goto.ll
    A llvm/test/CodeGen/X86/early-tail-dup-computed-goto.mir
    R llvm/test/CodeGen/X86/tail-dup-computed-goto.mir

  Log Message:
  -----------
  [TailDup] Delay aggressive computed-goto taildup to after RegAlloc. (#150911)

https://github.com/llvm/llvm-project/pull/114990 allowed more aggressive
tail duplication for computed-gotos in both pre- and post-regalloc tail
duplication.

In some cases, performing tail-duplication too early can lead to worse
results, especially if we duplicate blocks with a number of phi nodes.

This is causing a ~3% performance regression in some workloads using
Python 3.12.

This patch updates TailDup to delay aggressive tail-duplication for
computed gotos to after register allocation.

This means we can keep the non-duplicated version for a bit longer
throughout the backend, which should reduce compile-time as well as
allowing a number of optimizations and simplifications to trigger before
drastically expanding the CFG.

For the case in https://github.com/llvm/llvm-project/issues/106846, I
get the same performance with and without this patch on Skylake.

PR: https://github.com/llvm/llvm-project/pull/150911



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