mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-17 04:24:00 +00:00
uselistorder: Thread bit through ValueEnumerator
Canonicalize access to whether to preserve use-list order in bitcode on a `bool` stored in `ValueEnumerator`. Next step, expose this as a `bool` through `WriteBitcodeToFile()`. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234956 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -283,9 +283,11 @@ static bool isIntOrIntVectorValue(const std::pair<const Value*, unsigned> &V) {
|
||||
return V.first->getType()->isIntOrIntVectorTy();
|
||||
}
|
||||
|
||||
ValueEnumerator::ValueEnumerator(const Module &M)
|
||||
: HasMDString(false), HasMDLocation(false), HasGenericDebugNode(false) {
|
||||
if (shouldPreserveBitcodeUseListOrder())
|
||||
ValueEnumerator::ValueEnumerator(const Module &M,
|
||||
bool ShouldPreserveUseListOrder)
|
||||
: HasMDString(false), HasMDLocation(false), HasGenericDebugNode(false),
|
||||
ShouldPreserveUseListOrder(ShouldPreserveUseListOrder) {
|
||||
if (ShouldPreserveUseListOrder)
|
||||
UseListOrders = predictUseListOrder(M);
|
||||
|
||||
// Enumerate the global variables.
|
||||
@ -461,7 +463,7 @@ void ValueEnumerator::print(raw_ostream &OS, const MetadataMapType &Map,
|
||||
void ValueEnumerator::OptimizeConstants(unsigned CstStart, unsigned CstEnd) {
|
||||
if (CstStart == CstEnd || CstStart+1 == CstEnd) return;
|
||||
|
||||
if (shouldPreserveBitcodeUseListOrder())
|
||||
if (ShouldPreserveUseListOrder)
|
||||
// Optimizing constants makes the use-list order difficult to predict.
|
||||
// Disable it for now when trying to preserve the order.
|
||||
return;
|
||||
|
Reference in New Issue
Block a user