[all-commits] [llvm/llvm-project] 5ec238: Reapply db28934 "[IndVars] Pass TTI to replaceCong...

Dmitry Makogon via All-commits all-commits at lists.llvm.org
Tue Nov 9 02:42:59 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 5ec23863320ca12bfabb6dcff1d0425cb614b7a5
      https://github.com/llvm/llvm-project/commit/5ec23863320ca12bfabb6dcff1d0425cb614b7a5
  Author: Dmitry Makogon <d.makogon at g.nsu.ru>
  Date:   2021-11-09 (Tue, 09 Nov 2021)

  Changed paths:
    M llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
    M llvm/test/Transforms/GVN/gvn-eliminate-duplicating-phis.ll
    M llvm/test/Transforms/IndVarSimplify/X86/pr27133.ll
    M llvm/test/Transforms/IndVarSimplify/widen-loop-comp.ll
    M llvm/test/Transforms/LoopVectorize/X86/gather_scatter.ll
    M llvm/test/Transforms/PhaseOrdering/X86/pixel-splat.ll
    M llvm/test/Transforms/PhaseOrdering/X86/vdiv.ll

  Log Message:
  -----------
  Reapply db28934 "[IndVars] Pass TTI to replaceCongruentIVs"

This reapplies patch db289340c841990055a164e8eb2a3b5ff25677bf.

The test failures on build with expensive checks caused by the patch happened due
to the fact that we sorted loop Phis in replaceCongruentIVs using llvm::sort,
which shuffles the given container if the expensive checks are enabled,
so equivalent Phis in the sorted vector had different mutual order from run
to run. replaceCongruentIVs tries to replace narrow Phis with truncations
of wide ones. In some test cases there were several Phis with the same
width, so if their order differs from run to run, the narrow Phis would
be replaced with a different Phi, depending on the shuffling result.

The patch ae14fae0ff4304022beda5ab484f84ac0fdda807 fixed this issue by
replacing llvm::sort with llvm::stable_sort.




More information about the All-commits mailing list