[all-commits] [llvm/llvm-project] 8e9e22: [LoopFlatten] Fix IV increment use count

David Green via All-commits all-commits at lists.llvm.org
Mon Nov 21 23:24:08 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 8e9e22f07bcbe2ee95478684cf31948370e4e51e
      https://github.com/llvm/llvm-project/commit/8e9e22f07bcbe2ee95478684cf31948370e4e51e
  Author: David Green <david.green at arm.com>
  Date:   2022-11-22 (Tue, 22 Nov 2022)

  Changed paths:
    M llvm/lib/Transforms/Scalar/LoopFlatten.cpp
    M llvm/test/Transforms/LoopFlatten/widen-pr58441.ll

  Log Message:
  -----------
  [LoopFlatten] Fix IV increment use count

The add from the IV in the inner loop was always checking for 2 uses,
the phi and the compare. The compare could be based on the phi though,
leaving one valid use of the compare. In the testcase we could be left
with the phi and a lcssa phi as the two users, invalidly allowing
flattening where we shouldn't.

Fixes 58441

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




More information about the All-commits mailing list