[all-commits] [llvm/llvm-project] 9142f6: [SimplifyCFG] Don't widen cond br if false branch ...

Dmitry Makogon via All-commits all-commits at lists.llvm.org
Fri Aug 26 01:24:23 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 9142f67ef282570ebc4999045081e8c530f2054d
      https://github.com/llvm/llvm-project/commit/9142f67ef282570ebc4999045081e8c530f2054d
  Author: Dmitry Makogon <d.makogon at g.nsu.ru>
  Date:   2022-08-26 (Fri, 26 Aug 2022)

  Changed paths:
    M llvm/lib/Transforms/Utils/SimplifyCFG.cpp
    M llvm/test/Transforms/SimplifyCFG/pr52290.ll

  Log Message:
  -----------
  [SimplifyCFG] Don't widen cond br if false branch has successors

Fixes https://github.com/llvm/llvm-project/issues/57221.

This limits the tryWidenCondBranchToCondBranch transform making it
work only if the false block of widenable condition branch
has no successors.

If that block has successors, then SimplifyCondBranchToCondBranch
may undo the transform done by tryWidenCondBranchToCondBranch, which
would lead to infinite cycle of transformation and eventually
an assert failing.

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




More information about the All-commits mailing list