[all-commits] [llvm/llvm-project] ae14fa: [SCEVExpander] Use stable_sort to sort loop Phis i...
Dmitry Makogon via All-commits
all-commits at lists.llvm.org
Tue Nov 9 01:30:32 PST 2021
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: ae14fae0ff4304022beda5ab484f84ac0fdda807
https://github.com/llvm/llvm-project/commit/ae14fae0ff4304022beda5ab484f84ac0fdda807
Author: Dmitry Makogon <d.makogon at g.nsu.ru>
Date: 2021-11-09 (Tue, 09 Nov 2021)
Changed paths:
M llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp
Log Message:
-----------
[SCEVExpander] Use stable_sort to sort loop Phis in SCEVExpander::replaceCongruentIVs
This is a fix for test failures on expensive checks build caused by db289340c841990055a164e8eb2a3b5ff25677bf.
With LLVM_ENABLE_EXPENSIVE_CHECKS enabled the llvm::sort shuffles the given container.
However, the sort is only called when the TTI is passed to replaceCongruentIVs.
In the mentioned patch we pass it TTI, so the sort happens. But due to shuffling
equivalent Phis may appear in different order from run to run.
With the stable_sort instead of sort this is impossible - the order of sorted Phis
is preserved.
More information about the All-commits
mailing list