[all-commits] [llvm/llvm-project] 7b83a1: [GuardWidening] Improve analysis of potential wide...

Max Kazantsev via All-commits all-commits at lists.llvm.org
Wed Mar 22 01:15:41 PDT 2023

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 7b83a1438f9af064851bac3d74e05f794088d6d6
  Author: Max Kazantsev <mkazantsev at azul.com>
  Date:   2023-03-22 (Wed, 22 Mar 2023)

  Changed paths:
    M llvm/lib/Transforms/Scalar/GuardWidening.cpp
    M llvm/test/Transforms/GuardWidening/two_forms_behavior_consistency.ll

  Log Message:
  [GuardWidening] Improve analysis of potential widening into hotter block, try 2

The initial version was reverted because it looped infinitely if the likely successor
isn't properly dominated by the predecessor. In practice it means that we went up the
CFG through backedge and looped infinitely.

I also added some paranoid assertion checks to make sure that every other invariant
holds. I also found a hypothetical situation when we may go past the dominated block
while following the likely successors (it means that in fact the dominated block is
dynamically not reachable from dominating block) and explicitly prohibited this, though
I don't have a motivating test showing that it's a real problem.


More information about the All-commits mailing list