[llvm] 0b34226 - Use properlyDominates in RDFLiveness when sorting on dominance.
Alina Sbirlea via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 26 15:17:02 PDT 2020
Author: Alina Sbirlea
Date: 2020-08-26T15:16:40-07:00
New Revision: 0b342263043477ed2e2dc730468e9bfbcb375ac2
URL: https://github.com/llvm/llvm-project/commit/0b342263043477ed2e2dc730468e9bfbcb375ac2
DIFF: https://github.com/llvm/llvm-project/commit/0b342263043477ed2e2dc730468e9bfbcb375ac2.diff
LOG: Use properlyDominates in RDFLiveness when sorting on dominance.
Summary:
When looking for all reaching definitions, we sort basic blocks on dominance. When sorting looking for properlyDominates() handles the case A == B.
Authored by: pranavb
Differential Revision: https://reviews.llvm.org/D86661
Added:
Modified:
llvm/lib/CodeGen/RDFLiveness.cpp
Removed:
################################################################################
diff --git a/llvm/lib/CodeGen/RDFLiveness.cpp b/llvm/lib/CodeGen/RDFLiveness.cpp
index b2a29bf451a2a..50bd910739b5a 100644
--- a/llvm/lib/CodeGen/RDFLiveness.cpp
+++ b/llvm/lib/CodeGen/RDFLiveness.cpp
@@ -230,13 +230,12 @@ NodeList Liveness::getAllReachingDefs(RegisterRef RefRR,
TmpBB.push_back(Bucket.first);
if (Bucket.second.size() > 2)
GetOrder(*Bucket.first);
- std::sort(Bucket.second.begin(), Bucket.second.end(), Precedes);
+ llvm::sort(Bucket.second.begin(), Bucket.second.end(), Precedes);
}
// Sort the blocks with respect to dominance.
- std::sort(TmpBB.begin(), TmpBB.end(), [this](auto A, auto B) {
- return MDT.dominates(A, B);
- });
+ llvm::sort(TmpBB.begin(), TmpBB.end(),
+ [this](auto A, auto B) { return MDT.properlyDominates(A, B); });
std::vector<NodeId> TmpInst;
for (auto I = TmpBB.rbegin(), E = TmpBB.rend(); I != E; ++I) {
More information about the llvm-commits
mailing list