[all-commits] [llvm/llvm-project] a5ee62: [IndVars] Call replaceLoopPHINodesWithPreheaderVal...

Nikita Popov via All-commits all-commits at lists.llvm.org
Wed Jul 13 00:43:36 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: a5ee62a141fe791cc9b759a058f85339af45b362
      https://github.com/llvm/llvm-project/commit/a5ee62a141fe791cc9b759a058f85339af45b362
  Author: Nikita Popov <npopov at redhat.com>
  Date:   2022-07-13 (Wed, 13 Jul 2022)

  Changed paths:
    M llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
    M llvm/test/Transforms/IndVarSimplify/X86/loop-invariant-conditions.ll
    M llvm/test/Transforms/IndVarSimplify/X86/pr35406.ll
    M llvm/test/Transforms/IndVarSimplify/eliminate-comparison.ll
    M llvm/test/Transforms/IndVarSimplify/floating-point-iv.ll
    M llvm/test/Transforms/IndVarSimplify/lcssa-preservation.ll
    M llvm/test/Transforms/IndVarSimplify/no-iv-rewrite.ll
    M llvm/test/Transforms/IndVarSimplify/pr22222.ll
    M llvm/test/Transforms/IndVarSimplify/pr40454.ll
    M llvm/test/Transforms/IndVarSimplify/scev-expander-preserve-lcssa.ll
    M llvm/test/Transforms/IndVarSimplify/sentinel.ll
    M llvm/test/Transforms/LoopDeletion/pr53969.ll
    M llvm/test/Transforms/LoopVectorize/X86/pr54413-select-interleave-count-loop-with-cost-zero.ll

  Log Message:
  -----------
  [IndVars] Call replaceLoopPHINodesWithPreheaderValues() for already constant exits

Currently we only call replaceLoopPHINodesWithPreheaderValues() if
optimizeLoopExits() replaces the exit with an unconditional exit.
However, it is very common that this already happens as part of
eliminateIVComparison(), in which case we're leaving behind the
dead header phi.

Tweak the early bailout for already-constant exits to also call
replaceLoopPHINodesWithPreheaderValues().

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




More information about the All-commits mailing list