mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-24 23:28:41 +00:00
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214125 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -16,10 +16,23 @@
|
||||
#define LLVM_IR_USELISTORDER_H
|
||||
|
||||
#include "llvm/ADT/ArrayRef.h"
|
||||
#include "llvm/ADT/SmallVector.h"
|
||||
#include <vector>
|
||||
|
||||
namespace llvm {
|
||||
|
||||
class Module;
|
||||
class Function;
|
||||
class Value;
|
||||
|
||||
/// \brief Structure to hold a use-list order.
|
||||
struct UseListOrder {
|
||||
const Function *F;
|
||||
const Value *V;
|
||||
SmallVector<unsigned, 8> Shuffle;
|
||||
};
|
||||
|
||||
typedef std::vector<UseListOrder> UseListOrderStack;
|
||||
|
||||
/// \brief Whether to preserve use-list ordering.
|
||||
bool shouldPreserveBitcodeUseListOrder();
|
||||
|
Reference in New Issue
Block a user