[all-commits] [llvm/llvm-project] e8a5c1: [LoopInterchange] Improve inner exit loop safety c...

Florian Hahn via All-commits all-commits at lists.llvm.org
Wed Dec 4 09:46:29 PST 2019


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: e8a5c17211339a747d2bf5b0df708c8392121e6d
      https://github.com/llvm/llvm-project/commit/e8a5c17211339a747d2bf5b0df708c8392121e6d
  Author: Florian Hahn <flo at fhahn.com>
  Date:   2019-12-04 (Wed, 04 Dec 2019)

  Changed paths:
    M llvm/lib/Transforms/Scalar/LoopInterchange.cpp
    A llvm/test/Transforms/LoopInterchange/pr43473-invalid-lcssa-phis-in-inner-exit.ll

  Log Message:
  -----------
  [LoopInterchange] Improve inner exit loop safety checks.

The PHI node checks for inner loop exits are too permissive currently.
As indicated by an existing comment, we should only allow LCSSA PHI
nodes that are part of reductions or are only used outside of the loop
nest. We ensure this by checking the users of the LCSSA PHIs.
Specifically, it is not safe to use an exiting value from the inner loop in the latch of the outer
loop.

It also moves the inner loop exit check before the outer loop exit
check.

Fixes PR43473.

Reviewers: efriedma, mcrosier

Reviewed By: efriedma

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




More information about the All-commits mailing list