summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMandeep Singh Grang <mgrang@codeaurora.org>2017-11-20 19:17:11 +0000
committerMandeep Singh Grang <mgrang@codeaurora.org>2017-11-20 19:17:11 +0000
commitf953e4b881197bfeb959a61dc01bc20d9d88a513 (patch)
tree54981f0de811703beefa06c46066638a8dce2842
parent46f672b759f18b12e06e5eabc307e62a1ddaea55 (diff)
downloadbcm5719-llvm-f953e4b881197bfeb959a61dc01bc20d9d88a513.tar.gz
bcm5719-llvm-f953e4b881197bfeb959a61dc01bc20d9d88a513.zip
Revert "[SelectionDAG] Make sorting predicate stronger to remove non-deterministic ordering"
This broke the bots. Reverting this until I can fix the failures. This reverts commit 5a3db2856d12a3c4b400f487d39f8f05989e79f0. llvm-svn: 318686
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp13
1 files changed, 4 insertions, 9 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
index 3c2ca50a10f..f49e22b8288 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
@@ -9350,12 +9350,10 @@ bool SelectionDAGBuilder::buildBitTests(CaseClusterVector &Clusters,
BitTestInfo BTI;
std::sort(CBV.begin(), CBV.end(), [](const CaseBits &a, const CaseBits &b) {
- // Sort by probability first, number of bits second, bit mask third.
+ // Sort by probability first, number of bits second.
if (a.ExtraProb != b.ExtraProb)
return a.ExtraProb > b.ExtraProb;
- if (a.Bits != b.Bits)
- return a.Bits > b.Bits;
- return a.Mask < b.Mask;
+ return a.Bits > b.Bits;
});
for (auto &CB : CBV) {
@@ -9544,13 +9542,10 @@ void SelectionDAGBuilder::lowerWorkItem(SwitchWorkListItem W, Value *Cond,
}
if (TM.getOptLevel() != CodeGenOpt::None) {
- // Here, we order cases by probability so the most likely case will be
- // checked first. However, two clusters can have the same probability in
- // which case their relative ordering is non-deterministic. So we use Low
- // as a tie-breaker as clusters are guaranteed to never overlap.
+ // Order cases by probability so the most likely case will be checked first.
std::sort(W.FirstCluster, W.LastCluster + 1,
[](const CaseCluster &a, const CaseCluster &b) {
- return a.Prob != b.Prob ? a.Prob > b.Prob : a.Low < b.Low;
+ return a.Prob > b.Prob;
});
// Rearrange the case blocks so that the last one falls through if possible
OpenPOWER on IntegriCloud