[llvm] 7965126 - [Attributor][FIX] Properly return changed if the IR was modified
Johannes Doerfert via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 7 21:40:52 PDT 2020
Author: Johannes Doerfert
Date: 2020-09-07T23:38:08-05:00
New Revision: 79651265b2e08e105f3d66d5f75bc9f5fa803e45
URL: https://github.com/llvm/llvm-project/commit/79651265b2e08e105f3d66d5f75bc9f5fa803e45
DIFF: https://github.com/llvm/llvm-project/commit/79651265b2e08e105f3d66d5f75bc9f5fa803e45.diff
LOG: [Attributor][FIX] Properly return changed if the IR was modified
Deleting or replacing anything is certainly a modification. This caused
a later assertion in IPSCCP when compiling 400.perlbench with the new PM.
I'm not sure how to test this.
Added:
Modified:
llvm/lib/Transforms/IPO/Attributor.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Transforms/IPO/Attributor.cpp b/llvm/lib/Transforms/IPO/Attributor.cpp
index ea285b51982c..f020c4aaf1df 100644
--- a/llvm/lib/Transforms/IPO/Attributor.cpp
+++ b/llvm/lib/Transforms/IPO/Attributor.cpp
@@ -1306,9 +1306,27 @@ ChangeStatus Attributor::cleanupIR() {
CGUpdater.removeFunction(*Fn);
}
+ if (!ToBeChangedUses.empty())
+ ManifestChange = ChangeStatus::CHANGED;
+
+ if (!ToBeChangedToUnreachableInsts.empty())
+ ManifestChange = ChangeStatus::CHANGED;
+
if (!ToBeDeletedFunctions.empty())
ManifestChange = ChangeStatus::CHANGED;
+ if (!ToBeDeletedBlocks.empty())
+ ManifestChange = ChangeStatus::CHANGED;
+
+ if (!ToBeDeletedInsts.empty())
+ ManifestChange = ChangeStatus::CHANGED;
+
+ if (!InvokeWithDeadSuccessor.empty())
+ ManifestChange = ChangeStatus::CHANGED;
+
+ if (!DeadInsts.empty())
+ ManifestChange = ChangeStatus::CHANGED;
+
NumFnDeleted += ToBeDeletedFunctions.size();
LLVM_DEBUG(dbgs() << "[Attributor] Deleted " << NumFnDeleted
More information about the llvm-commits
mailing list