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.
Loading
Please register or sign in to comment