[all-commits] [llvm/llvm-project] 06c58f: [SCEV] Use backedge SCEV of PHI only if its input ...

dantrushin via All-commits all-commits at lists.llvm.org
Tue Mar 31 04:41:08 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 06c58f11a99a35da5799de8771cafdc47db69a8a
      https://github.com/llvm/llvm-project/commit/06c58f11a99a35da5799de8771cafdc47db69a8a
  Author: Denis Antrushin <dantrushin at gmail.com>
  Date:   2020-03-31 (Tue, 31 Mar 2020)

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

  Log Message:
  -----------
  [SCEV] Use backedge SCEV of PHI only if its input is loop invariant

For the PHI node

      %1 = phi [%A, %entry], [%X, %latch]

it is incorrect to use SCEV of backedge val %X as an exit value
of PHI unless %X is loop invariant.
This is because exit value of %1 is value of %X at one-before-last
iteration of the loop.

Reviewed By: Meinersbur
Differential Revision: https://reviews.llvm.org/D73181




More information about the All-commits mailing list