[all-commits] [llvm/llvm-project] f59205: [BasicBlockUtils] Add a new way for CreateControlF...

bcahoon via All-commits all-commits at lists.llvm.org
Mon Oct 31 07:03:58 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f59205aef957da9017285d4c0bb6f9c6f244621f
      https://github.com/llvm/llvm-project/commit/f59205aef957da9017285d4c0bb6f9c6f244621f
  Author: Brendon Cahoon <brendon.cahoon at amd.com>
  Date:   2022-10-31 (Mon, 31 Oct 2022)

  Changed paths:
    M llvm/include/llvm/Transforms/Utils/BasicBlockUtils.h
    M llvm/lib/Transforms/Utils/BasicBlockUtils.cpp
    M llvm/lib/Transforms/Utils/UnifyLoopExits.cpp
    M llvm/test/CodeGen/AMDGPU/si-annotate-cf.ll
    M llvm/test/Transforms/FixIrreducible/basic.ll
    M llvm/test/Transforms/StructurizeCFG/workarounds/needs-fr-ule.ll
    M llvm/test/Transforms/StructurizeCFG/workarounds/needs-unified-loop-exits.ll
    A llvm/test/Transforms/UnifyLoopExits/integer_guards.ll
    M llvm/test/Transforms/UnifyLoopExits/nested.ll
    M llvm/test/Transforms/UnifyLoopExits/restore-ssa.ll

  Log Message:
  -----------
  [BasicBlockUtils] Add a new way for CreateControlFlowHub()

The existing way of creating the predicate in the guard blocks uses
a boolean value per outgoing block. This increases the number of live
booleans as the number of outgoing blocks increases. The new way added
in this change is to store one integer to represent the outgoing block
we want to branch to, then at each guard block, an integer equality
check is performed to decide which a specific outgoing block is taken.

Using an integer reduces the number of live values and decreases
register pressure especially in cases where there are a large number
of outgoing blocks. The integer based approach is used when the
number of outgoing blocks crosses a threshold, which is currently set
to 32.

Patch by Ruiling Song.

Differential review: https://reviews.llvm.org/D127831




More information about the All-commits mailing list