diff options
author | Dehao Chen <dehao@google.com> | 2015-09-29 18:18:49 +0000 |
---|---|---|
committer | Dehao Chen <dehao@google.com> | 2015-09-29 18:18:49 +0000 |
commit | 028e122ca92bb85949df91639804451986f1c03d (patch) | |
tree | 0b9f163442dfdf758634667b14cd00ea3366c77f /llvm/lib/Transforms | |
parent | 236904ea9ea2f5d627ebbd71de8cae6ef2a551b1 (diff) | |
download | bcm5719-llvm-028e122ca92bb85949df91639804451986f1c03d.tar.gz bcm5719-llvm-028e122ca92bb85949df91639804451986f1c03d.zip |
Revert r248810 which breaks tests.
llvm-svn: 248814
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r-- | llvm/lib/Transforms/IPO/SampleProfile.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/IPO/SampleProfile.cpp b/llvm/lib/Transforms/IPO/SampleProfile.cpp index 70c82cc3a59..f99cc23c918 100644 --- a/llvm/lib/Transforms/IPO/SampleProfile.cpp +++ b/llvm/lib/Transforms/IPO/SampleProfile.cpp @@ -253,8 +253,6 @@ unsigned SampleProfileLoader::getBlockWeight(BasicBlock *BB) { if (InstWeight > Weight) Weight = InstWeight; } - if (Weight > 0) - VisitedBlocks.insert(BB); Entry.first->second = Weight; return Weight; } @@ -306,7 +304,8 @@ void SampleProfileLoader::findEquivalencesFor( for (auto *BB2 : Descendants) { bool IsDomParent = DomTree->dominates(BB2, BB1); bool IsInSameLoop = LI->getLoopFor(BB1) == LI->getLoopFor(BB2); - if (BB1 != BB2 && IsDomParent && IsInSameLoop) { + if (BB1 != BB2 && VisitedBlocks.insert(BB2).second && IsDomParent && + IsInSameLoop) { EquivalenceClass[BB2] = BB1; // If BB2 is heavier than BB1, make BB2 have the same weight |