mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-11-23 16:19:52 +00:00
CodeGen: Push the ModuleSlotTracker through Metadata
For another 1% speedup on the testcase in PR23865, push the `ModuleSlotTracker` through to metadata-related printing in `MachineBasicBlock::print()`. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240848 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -27,8 +27,11 @@
|
||||
#include <type_traits>
|
||||
|
||||
namespace llvm {
|
||||
|
||||
class LLVMContext;
|
||||
class Module;
|
||||
class ModuleSlotTracker;
|
||||
|
||||
template<typename ValueSubClass, typename ItemParentClass>
|
||||
class SymbolTableListTraits;
|
||||
|
||||
@@ -129,7 +132,11 @@ public:
|
||||
///
|
||||
/// If \c M is provided, metadata nodes will be numbered canonically;
|
||||
/// otherwise, pointer addresses are substituted.
|
||||
/// @{
|
||||
void printAsOperand(raw_ostream &OS, const Module *M = nullptr) const;
|
||||
void printAsOperand(raw_ostream &OS, ModuleSlotTracker &MST,
|
||||
const Module *M = nullptr) const;
|
||||
/// @}
|
||||
};
|
||||
|
||||
#define HANDLE_METADATA(CLASS) class CLASS;
|
||||
|
||||
@@ -41,8 +41,13 @@ public:
|
||||
|
||||
/// Construct a slot tracker from a module.
|
||||
///
|
||||
/// If \a M is \c nullptr, uses a null slot tracker.
|
||||
explicit ModuleSlotTracker(const Module *M);
|
||||
/// If \a M is \c nullptr, uses a null slot tracker. Otherwise, initializes
|
||||
/// a slot tracker, and initializes all metadata slots. \c
|
||||
/// ShouldInitializeAllMetadata defaults to true because this is expected to
|
||||
/// be shared between multiple callers, and otherwise MDNode references will
|
||||
/// not match up.
|
||||
explicit ModuleSlotTracker(const Module *M,
|
||||
bool ShouldInitializeAllMetadata = true);
|
||||
|
||||
/// Destructor to clean up storage.
|
||||
~ModuleSlotTracker();
|
||||
|
||||
Reference in New Issue
Block a user