[all-commits] [llvm/llvm-project] cc7cb0: [BasicBlock] fix looping in getPostdominatingDeopt...

Fedor Sergeev via All-commits all-commits at lists.llvm.org
Fri Jan 17 04:40:50 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: cc7cb05e9d7f3c6eac48055069c83b1426e3c6b7
      https://github.com/llvm/llvm-project/commit/cc7cb05e9d7f3c6eac48055069c83b1426e3c6b7
  Author: Fedor Sergeev <fedor.sergeev at azul.com>
  Date:   2020-01-17 (Fri, 17 Jan 2020)

  Changed paths:
    M llvm/lib/IR/BasicBlock.cpp
    A llvm/test/Transforms/LoopPredication/unswitch-exit-loop.ll

  Log Message:
  -----------
  [BasicBlock] fix looping in getPostdominatingDeoptimizeCall

Blindly following unique-successors chain appeared to be a bad idea.
In a degenerate case when block jumps to itself that goes into endless loop.

Discovered this problem when playing with additional changes,
managed to reproduce it on existing LoopPredication code.

Fix by checking a "visited" set while iterating through unique successors.

Reviewed By: skatkov

Tags: #llvm

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




More information about the All-commits mailing list