summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/SymbolTableListTraitsImpl.h
diff options
context:
space:
mode:
authorReid Kleckner <rnk@google.com>2019-01-23 22:59:52 +0000
committerReid Kleckner <rnk@google.com>2019-01-23 22:59:52 +0000
commite80799e6afc6959d61e086080ec490df397ee122 (patch)
treea2f66a4baec5a90e0ed610b532cf5c32c720219b /llvm/lib/IR/SymbolTableListTraitsImpl.h
parent1ecf6e55cd8b2ebeb506f5c5ce8080a616b4ac5b (diff)
downloadbcm5719-llvm-e80799e6afc6959d61e086080ec490df397ee122.tar.gz
bcm5719-llvm-e80799e6afc6959d61e086080ec490df397ee122.zip
[ADT] Notify ilist traits about in-list transfers
Summary: Previously no client of ilist traits has needed to know about transfers of nodes within the same list, so as an optimization, ilist doesn't call transferNodesFromList in that case. However, now there are clients that want to use ilist traits to cache instruction ordering information to optimize dominance queries of instructions in the same basic block. This change updates the existing ilist traits users to detect in-list transfers and do nothing in that case. After this change, we can start caching instruction ordering information in LLVM IR data structures. There are two main ways to do that: - by putting an order integer into the Instruction class - by maintaining order integers in a hash table on BasicBlock I plan to implement and measure both, but I wanted to commit this change first to enable other out of tree ilist clients to implement this optimization as well. Reviewers: lattner, hfinkel, chandlerc Subscribers: hiraditya, dexonsmith, llvm-commits Differential Revision: https://reviews.llvm.org/D57120 llvm-svn: 351992
Diffstat (limited to 'llvm/lib/IR/SymbolTableListTraitsImpl.h')
-rw-r--r--llvm/lib/IR/SymbolTableListTraitsImpl.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/IR/SymbolTableListTraitsImpl.h b/llvm/lib/IR/SymbolTableListTraitsImpl.h
index a74ac8a960f..f399c823d6f 100644
--- a/llvm/lib/IR/SymbolTableListTraitsImpl.h
+++ b/llvm/lib/IR/SymbolTableListTraitsImpl.h
@@ -83,7 +83,8 @@ void SymbolTableListTraits<ValueSubClass>::transferNodesFromList(
SymbolTableListTraits &L2, iterator first, iterator last) {
// We only have to do work here if transferring instructions between BBs
ItemParentClass *NewIP = getListOwner(), *OldIP = L2.getListOwner();
- assert(NewIP != OldIP && "Expected different list owners");
+ if (NewIP == OldIP)
+ return;
// We only have to update symbol table entries if we are transferring the
// instructions to a different symtab object...
OpenPOWER on IntegriCloud