[all-commits] [llvm/llvm-project] bb2e85: [AMDGPU] Improve StructurizeCFG pass performance: ...

Valery Pykhtin via All-commits all-commits at lists.llvm.org
Mon Mar 10 23:20:14 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: bb2e85f12f6a17afdb36b2ffd2dcd17bbc4dd866
      https://github.com/llvm/llvm-project/commit/bb2e85f12f6a17afdb36b2ffd2dcd17bbc4dd866
  Author: Valery Pykhtin <valery.pykhtin at gmail.com>
  Date:   2025-03-11 (Tue, 11 Mar 2025)

  Changed paths:
    M llvm/lib/Transforms/Scalar/StructurizeCFG.cpp

  Log Message:
  -----------
  [AMDGPU] Improve StructurizeCFG pass performance: avoid redundant DebugLoc map initialization. NFC. (#130568)

Previously, the TermDL (BB terminator → DebugLoc) map was initialized at
the start of processing each function's region, creating entries for the
entire function. This could be inefficient for large functions.

This patch improves performance by creating map entries only when
needed—when a terminator is being killed or when a flow block is
created. Additionally, entries are removed immediately after use,
preventing unnecessary map growth and ensuring DebugLocs are not
"retracked."

A mapless variant was also explored, but due to limited familiarity with
the structurizer, it was not pursued further.

In my cases, this change improves performance by 2-3×.



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