[all-commits] [llvm/llvm-project] d7a307: Simplify/cleanup BasicBlockUtilsTest

Matthias Braun via All-commits all-commits at lists.llvm.org
Wed Feb 23 16:29:15 PST 2022


  Branch: refs/heads/github/main
  Home:   https://github.com/llvm/llvm-project
  Commit: d7a307320e50a0c83d052b04c766e9cf4d618b37
      https://github.com/llvm/llvm-project/commit/d7a307320e50a0c83d052b04c766e9cf4d618b37
  Author: Matthias Braun <matze at braunis.de>
  Date:   2022-02-23 (Wed, 23 Feb 2022)

  Changed paths:
    M llvm/unittests/Transforms/Utils/BasicBlockUtilsTest.cpp

  Log Message:
  -----------
  Simplify/cleanup BasicBlockUtilsTest

Cleanup BasicBolckUtilsTest using C++ raw string literals, remove
duplicated block functions and smaller style changes.

Differential Revision: https://reviews.llvm.org/D120095


  Commit: 6a383369f9b800eac5de2456e49fa70577be8e33
      https://github.com/llvm/llvm-project/commit/6a383369f9b800eac5de2456e49fa70577be8e33
  Author: Matthias Braun <matthiasb at fb.com>
  Date:   2022-02-23 (Wed, 23 Feb 2022)

  Changed paths:
    M llvm/include/llvm/Transforms/Utils/BasicBlockUtils.h
    M llvm/lib/CodeGen/CodeGenPrepare.cpp
    M llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp
    M llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp
    M llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp
    M llvm/test/Transforms/GCOVProfiling/split-indirectbr-critical-edges.ll
    M llvm/test/Transforms/PGOProfile/Inputs/irreducible.proftext
    M llvm/test/Transforms/PGOProfile/Inputs/irreducible_entry.proftext
    M llvm/test/Transforms/PGOProfile/irreducible.ll
    M llvm/test/Transforms/PGOProfile/split-indirectbr-critical-edges.ll
    M llvm/unittests/Transforms/Utils/BasicBlockUtilsTest.cpp

  Log Message:
  -----------
  PGOInstrumentation, GCOVProfiling: Split indirectbr critical edges regardless of PHIs

The `SplitIndirectBrCriticalEdges` function was originally designed for
`CodeGenPrepare` and skipped splitting of edges when the destination
block didn't contain any `PHI` instructions. This only makes sense when
reducing COPYs like `CodeGenPrepare`. In the case of
`PGOInstrumentation` or `GCOVProfiling` it would result in missed
counters and wrong result in functions with computed goto.

Differential Revision: https://reviews.llvm.org/D120096


Compare: https://github.com/llvm/llvm-project/compare/d7a307320e50%5E...6a383369f9b8


More information about the All-commits mailing list