Skip to content
Commit 5ec23863 authored by Dmitry Makogon's avatar Dmitry Makogon
Browse files

Reapply db289340 "[IndVars] Pass TTI to replaceCongruentIVs"

This reapplies patch db289340.

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 ae14fae0 fixed this issue by
replacing llvm::sort with llvm::stable_sort.
parent acbefbf1
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment