[all-commits] [llvm/llvm-project] 5b0dba: [NewGVN] Fix caching for OpIsSafeForPhiOfOps (#98340)

ManuelJBrito via All-commits all-commits at lists.llvm.org
Fri Jul 12 03:18:07 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 5b0dba13a5632d944d1eac8b39f44f65ec524e86
      https://github.com/llvm/llvm-project/commit/5b0dba13a5632d944d1eac8b39f44f65ec524e86
  Author: ManuelJBrito <59119670+ManuelJBrito at users.noreply.github.com>
  Date:   2024-07-12 (Fri, 12 Jul 2024)

  Changed paths:
    M llvm/lib/Transforms/Scalar/NewGVN.cpp
    A llvm/test/Transforms/NewGVN/cache-safe-phiofops.ll

  Log Message:
  -----------
  [NewGVN] Fix caching for OpIsSafeForPhiOfOps (#98340)

The caching mechanism for 'OpIsSafeForPhiOfOps' is unsound. An operand
is deemed unsafe for PhiOfOps if it depends on a phi that resides in the
same block as the Phi block, i.e., where we are performing the PhiOfOps.
This is to avoid having to materialize the translated subexpressions. To
avoid redundant code walking, a cache is used to store these results.
Note, however, that since the safety is specific to the Phi block, we
cannot, in general, use the cached results for other blocks.

This patch addresses this by having a cache per block instead of a
single one for the entire function. closes #63335



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