summaryrefslogtreecommitdiff
path: root/llvm/utils/TableGen/Common/CodeGenSchedule.h
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@sifive.com>2025-01-23 12:48:59 -0800
committerGitHub <noreply@github.com>2025-01-23 12:48:59 -0800
commite19261faf5c771bd7951b987abe8de698469e9f1 (patch)
treeabaa23f05ea123dfe5a521bac31086bc6da0559e /llvm/utils/TableGen/Common/CodeGenSchedule.h
parent0b7cbd23a043ea4c14bd13ccd737049d38f64b5d (diff)
[TableGen] Add a SmallPtrSet to track WriteRes that are referenced by some ReadAdvance. NFC (#124160)
Use this to remove a linear scan from CodeGenProcModel::hasReadOfWrite. This reduces build time of RISCVGenSubtargetInfo.inc on by machine from ~6 seconds to ~3 seconds.
Diffstat (limited to 'llvm/utils/TableGen/Common/CodeGenSchedule.h')
-rw-r--r--llvm/utils/TableGen/Common/CodeGenSchedule.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/utils/TableGen/Common/CodeGenSchedule.h b/llvm/utils/TableGen/Common/CodeGenSchedule.h
index 5d5aa44d882e..0dce1fa30811 100644
--- a/llvm/utils/TableGen/Common/CodeGenSchedule.h
+++ b/llvm/utils/TableGen/Common/CodeGenSchedule.h
@@ -19,6 +19,7 @@
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/DenseSet.h"
#include "llvm/ADT/STLExtras.h"
+#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/TableGen/Record.h"
#include "llvm/TableGen/SetTheory.h"
@@ -250,6 +251,9 @@ struct CodeGenProcModel {
// Map from the ReadType field to the parent ReadAdvance record.
DenseMap<const Record *, const Record *> ReadAdvanceMap;
+ // Set of WriteRes that are referenced by a ReadAdvance.
+ SmallPtrSet<const Record *, 8> ReadOfWriteSet;
+
// Per-operand machine model resources associated with this processor.
ConstRecVec ProcResourceDefs;