[all-commits] [llvm/llvm-project] fa4cc9: [FixIrreducible] Use CycleInfo instead of a custom...

Sameer Sahasrabuddhe via All-commits all-commits at lists.llvm.org
Mon Aug 26 03:21:55 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: fa4cc9ddd58eb9fef2497e678873ff3b495340a3
      https://github.com/llvm/llvm-project/commit/fa4cc9ddd58eb9fef2497e678873ff3b495340a3
  Author: Sameer Sahasrabuddhe <sameer.sahasrabuddhe at amd.com>
  Date:   2024-08-26 (Mon, 26 Aug 2024)

  Changed paths:
    M llvm/include/llvm/ADT/GenericCycleInfo.h
    M llvm/lib/Transforms/Utils/FixIrreducible.cpp
    M llvm/test/CodeGen/AMDGPU/llc-pipeline.ll
    M llvm/test/Transforms/FixIrreducible/basic.ll
    M llvm/test/Transforms/FixIrreducible/bug45623.ll
    M llvm/test/Transforms/FixIrreducible/nested.ll
    M llvm/test/Transforms/FixIrreducible/switch.ll
    M llvm/test/Transforms/FixIrreducible/unreachable.ll
    M llvm/test/Transforms/StructurizeCFG/workarounds/needs-fix-reducible.ll
    M llvm/test/Transforms/StructurizeCFG/workarounds/needs-fr-ule.ll

  Log Message:
  -----------
  [FixIrreducible] Use CycleInfo instead of a custom SCC traversal (#101386)

[FixIrreducible] Use CycleInfo instead of a custom SCC traversal

1. CycleInfo efficiently locates all cycles in a single pass, while the
SCC is
   repeated inside every natural loop.

2. CycleInfo provides a hierarchy of irreducible cycles, and the new
implementation transforms each cycle in this hierarchy separately
instead of
reducing an entire irreducible SCC in a single step. This reduces the
number
of control-flow paths that pass through the header of each newly created
loop. This is evidenced by the reduced number of predecessors on the
"guard"
blocks in the lit tests, and fewer operands on the corresponding PHI
nodes.

3. When an entry of an irreducible cycle is the header of a child
natural loop,
the original implementation destroyed that loop. This is now preserved,
   since the incoming edges on non-header entries are not touched.

4. In the new implementation, if an irreducible cycle is a superset of a
natural
loop with the same header, then that natural loop is destroyed and
replaced
   by the newly created loop.



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