summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Bitcode/Writer/ValueEnumerator.h
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2014-07-28 21:19:41 +0000
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2014-07-28 21:19:41 +0000
commit1f66c856b54e32e6590d1333fc8a60d56979edb8 (patch)
tree768875d352946ca33ca6773c03aada1ebb4f3c24 /llvm/lib/Bitcode/Writer/ValueEnumerator.h
parentf59b735a80004aa951e6f5e250231eb4b6fb18c8 (diff)
downloadbcm5719-llvm-1f66c856b54e32e6590d1333fc8a60d56979edb8.tar.gz
bcm5719-llvm-1f66c856b54e32e6590d1333fc8a60d56979edb8.zip
Bitcode: Serialize (and recover) use-list order
Predict and serialize use-list order in bitcode. This makes the option `-preserve-bc-use-list-order` work *most* of the time, but this is still experimental. - Builds a full value-table up front in the writer, sets up a list of use-list orders to write out, and discards the table. This is a simpler first step than determining the order from the various overlapping IDs of values on-the-fly. - The shuffles stored in the use-list order list have an unnecessarily large memory footprint. - `blockaddress` expressions cause functions to be materialized out-of-order. For now I've ignored this problem, so use-list orders will be wrong for constants used by functions that have block addresses taken. There are a couple of ways to fix this, but I don't have a concrete plan yet. - When materializing functions lazily, the use-lists for constants will not be correct. This use case is out of scope: what should the use-list order be, if it's incomplete? This is part of PR5680. llvm-svn: 214125
Diffstat (limited to 'llvm/lib/Bitcode/Writer/ValueEnumerator.h')
-rw-r--r--llvm/lib/Bitcode/Writer/ValueEnumerator.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/Bitcode/Writer/ValueEnumerator.h b/llvm/lib/Bitcode/Writer/ValueEnumerator.h
index 1c9f38e07b4..62488936b2f 100644
--- a/llvm/lib/Bitcode/Writer/ValueEnumerator.h
+++ b/llvm/lib/Bitcode/Writer/ValueEnumerator.h
@@ -18,6 +18,7 @@
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/UniqueVector.h"
#include "llvm/IR/Attributes.h"
+#include "llvm/IR/UseListOrder.h"
#include <vector>
namespace llvm {
@@ -42,6 +43,9 @@ public:
// For each value, we remember its Value* and occurrence frequency.
typedef std::vector<std::pair<const Value*, unsigned> > ValueList;
+
+ UseListOrderStack UseListOrders;
+
private:
typedef DenseMap<Type*, unsigned> TypeMapType;
TypeMapType TypeMap;
OpenPOWER on IntegriCloud