[all-commits] [llvm/llvm-project] 9f8f6c: [SROA] Avoid expensive isComplete() call (NFC)

Nikita Popov via All-commits all-commits at lists.llvm.org
Tue Jul 2 07:42:23 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 9f8f6ce53cb7bc3f139db7b8f614a4f0e9a1b579
      https://github.com/llvm/llvm-project/commit/9f8f6ce53cb7bc3f139db7b8f614a4f0e9a1b579
  Author: Nikita Popov <npopov at redhat.com>
  Date:   2024-07-02 (Tue, 02 Jul 2024)

  Changed paths:
    M llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp

  Log Message:
  -----------
  [SROA] Avoid expensive isComplete() call (NFC)

https://github.com/llvm/llvm-project/pull/83381 introduced a call
to PHINode::isComplete() in Mem2Reg, which is O(n^2) in the number
of predecessors, resulting in pathological compile-time regressions
for cases with many predecessors.

Remove the isComplete() check and instead cache the attribute
lookup, to only perform it once per function. Actually setting
the FMF flag is cheap.



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