aboutsummaryrefslogtreecommitdiff
path: root/lib/IR/LegacyPassManager.cpp
diff options
context:
space:
mode:
authorPhilip Reames <listmail@philipreames.com>2015-12-07 22:41:23 +0000
committerPhilip Reames <listmail@philipreames.com>2015-12-07 22:41:23 +0000
commit0890b95b60c353074d8d3a2e11906e66282e30da (patch)
tree7aee8d516ab23fb90949d1036dd2de3e6aac2105 /lib/IR/LegacyPassManager.cpp
parent3ff1b160f82fb7887a77f41d5c1f47d9e9126af9 (diff)
Reapply 254950 w/fix
254950 ended up being not NFC. The previous code was overriding the flags for whether an instruction read or wrote memory using the target specific flags returned via TTI. I'd missed this in my refactoring. Since I mistakenly built only x86 and didn't notice the number of unsupported tests, I didn't catch that before the original checkin. This raises an interesting issue though. Given we have function attributes (i.e. readonly, readnone, argmemonly) which describe the aliasing of intrinsics, why does TTI have this information overriding the instruction definition at all? I see no reason for this, but decided to preserve existing behavior for the moment. The root issue might be that we don't have a "writeonly" attribute. Original commit message: [EarlyCSE] Simplify and invert ParseMemoryInst [NFCI] Restructure ParseMemoryInst - which was introduced to abstract over target specific load and stores instructions - to just query the underlying instructions. In theory, this could be slightly slower than caching the results, but in practice, it's very unlikely to be measurable. The simple query scheme makes it far easier to understand, and much easier to extend with new queries. Given I'm about to need to add new query types, doing the cleanup first seemed worthwhile. Do we still believe the target specific intrinsic handling is worthwhile in EarlyCSE? It adds quite a bit of complexity and makes the code harder to read. Being able to delete the abstraction entirely would be wonderful. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254957 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/IR/LegacyPassManager.cpp')
-rw-r--r--lib/IR/LegacyPassManager.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/IR/LegacyPassManager.cpp b/lib/IR/LegacyPassManager.cpp
index f2e0c7d32c0..3fa11f0d51a 100644
--- a/lib/IR/LegacyPassManager.cpp
+++ b/lib/IR/LegacyPassManager.cpp
@@ -589,6 +589,12 @@ AnalysisUsage *PMTopLevelManager::findAnalysisUsage(Pass *P) {
if (auto *N = UniqueAnalysisUsages.FindNodeOrInsertPos(ID, IP))
Node = N;
else {
+#if 0
+ dbgs() << AU.getRequiredSet().size() << " "
+ << AU.getRequiredTransitiveSet().size() << " "
+ << AU.getPreservedSet().size() << " "
+ << AU.getUsedSet().size() << "\n";
+#endif
Node = new (AUFoldingSetNodeAllocator.Allocate()) AUFoldingSetNode(AU);
UniqueAnalysisUsages.InsertNode(Node, IP);
}