[all-commits] [llvm/llvm-project] c8b675: [SCEV] Use umin_seq for BECount of multi-exit loops

Nikita Popov via All-commits all-commits at lists.llvm.org
Sat May 21 06:48:33 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c8b675eaa1de1d4edebd0292ca6de3180c687127
      https://github.com/llvm/llvm-project/commit/c8b675eaa1de1d4edebd0292ca6de3180c687127
  Author: Nikita Popov <nikita.ppv at gmail.com>
  Date:   2022-05-21 (Sat, 21 May 2022)

  Changed paths:
    M llvm/lib/Analysis/ScalarEvolution.cpp
    M llvm/test/Transforms/IndVarSimplify/ARM/code-size.ll
    M llvm/test/Transforms/IndVarSimplify/loop-predication.ll
    M llvm/test/Transforms/IndVarSimplify/post-inc-range.ll
    M llvm/test/Transforms/PhaseOrdering/AArch64/peel-multiple-unreachable-exits-for-vectorization.ll

  Log Message:
  -----------
  [SCEV] Use umin_seq for BECount of multi-exit loops

When computing the BECount for multi-exit loops, we need to combine
individual exit counts using umin_seq rather than umin. This is
because an earlier exit may exit on the first iteration, in which
case later exit expressions will not be evaluated and could be
poisonous. We cannot propagate potential poison values from later
exits.

In particular, this avoids the introduction of "branch on poison"
UB when optimizing multi-exit loops.

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




More information about the All-commits mailing list