[all-commits] [llvm/llvm-project] fee330: [SCEV] Fix false-positive recognition of simple re...

max-azul via All-commits all-commits at lists.llvm.org
Tue Apr 6 23:55:46 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: fee330824a2b3d7e502a27e1464c418a4663d7a3
      https://github.com/llvm/llvm-project/commit/fee330824a2b3d7e502a27e1464c418a4663d7a3
  Author: Max Kazantsev <mkazantsev at azul.com>
  Date:   2021-04-07 (Wed, 07 Apr 2021)

  Changed paths:
    M llvm/lib/Analysis/ScalarEvolution.cpp
    A llvm/test/Analysis/ScalarEvolution/pr49856.ll

  Log Message:
  -----------
  [SCEV] Fix false-positive recognition of simple recurrences. PR49856

A value from reachable block may come to a Phi node as its input from
unreachable block. This may confuse matchSimpleRecurrence  which
has no access to DomTree and can falsely recognize something as a recurrency
because of this effect, as the attached test shows.

Patch `ae7b1e` deals with half of this problem, but it only accounts from
the case when an unreachable instruction comes to Phi as an input.

This patch provides a generalization by checking that no Phi block's
predecessor is unreachable (no matter what the input is).

Differential Revision: https://reviews.llvm.org/D99929
Reviewed By: reames




More information about the All-commits mailing list