Skip to content

Commit 7ed14f4

Browse files
pkwasnie-inteligcbot
authored andcommitted
Early Register Estimator - filter dump
Adds new flag to dump only selected functions in Early Register Estimator.
1 parent 829721c commit 7ed14f4

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

IGC/Compiler/CISACodeGen/IGCLivenessAnalysis.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ SPDX-License-Identifier: MIT
2020

2121
#include <fstream>
2222
#include <queue>
23+
#include <regex>
2324

2425
char IGCLivenessAnalysis::ID = 0;
2526
// Register pass to igc-opt
@@ -381,6 +382,10 @@ void IGCLivenessAnalysis::intraBlock(llvm::BasicBlock &BB, std::string &Output,
381382

382383
void IGCLivenessAnalysis::dumpRegPressure(llvm::Function &F,
383384
unsigned int SIMD) {
385+
const char *Filter = IGC_GET_REGKEYSTRING(DumpRegPressureEstimateFilter);
386+
if (Filter && *Filter != '\0' && !std::regex_search(F.getName().str(), std::regex(Filter)))
387+
return;
388+
384389
// force print all
385390
PrinterType = 5;
386391

IGC/common/igc_flags.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -742,6 +742,7 @@ DECLARE_IGC_REGKEY(bool, RematSameBBScope, true, "Confine rematerialization only
742742
DECLARE_IGC_REGKEY(bool, EnableRemat, false, "Enable clone adress arithmetic pass not only on retry", false)
743743
DECLARE_IGC_REGKEY(bool, RematReassocBefore, false, "Enable short sequence of passes before clone address arithmetic pass to potentially decrese amount of operations that will be rematerialized", false)
744744
DECLARE_IGC_REGKEY(bool, DumpRegPressureEstimate, false, "Dump RegPressureEstimate to a file", false)
745+
DECLARE_IGC_REGKEY(debugString, DumpRegPressureEstimateFilter, 0, "Only dump RegPressureEstimate for functions matching the given regex", false)
745746
DECLARE_IGC_REGKEY(bool, EnableReusingXYZWStoreConstPayload, true, "Enable reusing XYZW stores const payload", false)
746747
DECLARE_IGC_REGKEY(bool, EnableReusingLSCStoreConstPayload, false, "Enable reusing LSC stores const payload", false)
747748
DECLARE_IGC_REGKEY(DWORD, RegPressureVerbocity, 0, "Different printing types", false)

0 commit comments

Comments
 (0)