Skip to content

Commit 17c1de9

Browse files
lwesiersigcbot
authored andcommitted
Remove igc metrics
Remove igc metrics
1 parent 61f6fde commit 17c1de9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+11
-2839
lines changed

IGC/AdaptorOCL/UnifyIROCL.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,6 @@ SPDX-License-Identifier: MIT
136136

137137
#include <string>
138138

139-
#include <Metrics/IGCMetric.h>
140-
141139
using namespace llvm;
142140
using namespace IGC::IGCMD;
143141
using namespace IGC::Debug;
@@ -185,9 +183,6 @@ static void CommonOCLBasedPasses(OpenCLProgramContext *pContext) {
185183

186184
setupTriple(*pContext);
187185

188-
pContext->metrics.Init(&pContext->hash, pContext->getModule()->getNamedMetadata("llvm.dbg.cu") != nullptr);
189-
pContext->metrics.CollectFunctions(pContext->getModule());
190-
191186
unify_opt_PreProcess(pContext);
192187
pContext->m_checkFastFlagPerInstructionInCustomUnsafeOptPass = true;
193188
pContext->m_mayHaveUnalignedAddressRegister = true;

IGC/AdaptorOCL/dllInterfaceCompute.cpp

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,6 @@ SPDX-License-Identifier: MIT
135135
#include <llvm/Support/SourceMgr.h>
136136
#include "common/LLVMWarningsPop.hpp"
137137

138-
#include "IGC/Metrics/IGCMetric.h"
139-
140138
using namespace IGC::IGCMD;
141139
using namespace IGC::Debug;
142140
using namespace IGC;
@@ -1157,7 +1155,6 @@ bool TranslateBuildSPMD(const STB_TranslateInputArgs *pInputArgs, STB_TranslateO
11571155
compOpt->FloatDenormModeBFTF = FLOAT_DENORM_RETAIN;
11581156
}
11591157

1160-
unsigned PtrSzInBits = pKernelModule->getDataLayout().getPointerSizeInBits();
11611158
// TODO: Again, this should not happen on each compilation
11621159

11631160
bool doSplitModule = oclContext.m_InternalOptions.CompileOneKernelAtTime || IGC_IS_FLAG_ENABLED(CompileOneAtTime);
@@ -1312,17 +1309,11 @@ bool TranslateBuildSPMD(const STB_TranslateInputArgs *pInputArgs, STB_TranslateO
13121309
SetOutputMessage(oclContext.GetWarning(), *pOutputArgs);
13131310
}
13141311

1315-
// Prepare and set program binary
1316-
unsigned int pointerSizeInBytes = (PtrSzInBits == 64) ? 8 : 4;
1317-
13181312
// FIXME: zebin currently only support program output itself, will add debug info
13191313
// into it
13201314
size_t binarySize = 0;
13211315
char *binaryOutput = nullptr;
13221316

1323-
oclContext.metrics.FinalizeStats();
1324-
oclContext.metrics.OutputMetrics();
1325-
13261317
llvm::SmallVector<char, 64> buf;
13271318
llvm::raw_svector_ostream llvm_os(buf);
13281319
const bool excludeIRFromZEBinary =
@@ -1334,12 +1325,14 @@ bool TranslateBuildSPMD(const STB_TranslateInputArgs *pInputArgs, STB_TranslateO
13341325
spv_size = pInputArgs->InputSize;
13351326
}
13361327

1337-
// IGC metrics
1338-
size_t metricDataSize = oclContext.metrics.getMetricDataSize();
1339-
auto metricData = reinterpret_cast<const char *>(oclContext.metrics.getMetricData());
1328+
// IGC metrics are empty
1329+
auto metricData = "n\a";
1330+
size_t metricDataSize = sizeof(metricData);
13401331

1332+
unsigned PtrSzInBits = pKernelModule->getDataLayout().getPointerSizeInBits();
1333+
unsigned int pointerSizeInBytes = (PtrSzInBits == 64) ? 8 : 4;
13411334
oclContext.m_programOutput.GetZEBinary(llvm_os, pointerSizeInBytes, spv_data, spv_size, metricData, metricDataSize,
1342-
pInputArgs->pOptions, pInputArgs->OptionsSize);
1335+
pInputArgs->pOptions, pInputArgs->OptionsSize);
13431336

13441337
// FIXME: try to avoid memory copy here
13451338
binarySize = buf.size();

IGC/CMakeLists.txt

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1533,9 +1533,6 @@ igc_sg_define(IGC__common)
15331533
igc_sg_define(IGC__Common_CLElfLib)
15341534

15351535

1536-
# Add protobuf
1537-
include(igc_find_protobuf)
1538-
15391536
set(IGC_BUILD__SPIRV_TOOLS_ENABLED ON)
15401537

15411538
if(IGC_BUILD__SPIRV_TOOLS_ENABLED)
@@ -1636,9 +1633,6 @@ if(MSVC)
16361633
)
16371634
endif()
16381635

1639-
#Metrcis
1640-
include(Metrics/protobuf_metrics.cmake)
1641-
16421636
# Sources/headers for main libraries.
16431637
set(IGC_BUILD__SRC__IGC__igc_common
16441638
${IGC_BUILD__SRC__IGC_AdaptorOCL}
@@ -1902,10 +1896,6 @@ foreach(_libBuildSuffix ${IGC_BUILD__MAIN_IGC_LIB_SUFFIXES})
19021896
)
19031897
endif()
19041898

1905-
#Metrics
1906-
list(APPEND _targetLinkLineCommon
1907-
igc_metric
1908-
)
19091899

19101900
list(APPEND _targetLinkLineCommon zebinlib)
19111901
list(APPEND _targetLinkLineCommon IGCOptions)

IGC/Compiler/CISACodeGen/CISABuilder.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3655,11 +3655,6 @@ void CEncoder::InitVISABuilderOptions(TARGET_PLATFORM VISAPlatform, bool canAbor
36553655
SaveOption(vISA_GenerateDebugInfo, true);
36563656
}
36573657

3658-
if (context->metrics.Enable()) {
3659-
SaveOption(vISA_GenerateKernelInfo, true);
3660-
SaveOption(vISA_EmitLocation, true);
3661-
}
3662-
36633658
if (canAbortOnSpill) {
36643659
SaveOption(vISA_AbortOnSpill, true);
36653660
}
@@ -5405,9 +5400,6 @@ void CEncoder::Compile(bool hasSymbolTable, GenXFunctionGroupAnalysis *&pFGA) {
54055400

54065401
KERNEL_INFO *vISAstats;
54075402
pMainKernel->GetKernelInfo(vISAstats);
5408-
// Collect metrics from vISA
5409-
context->metrics.CollectRegStats(vISAstats, m_program->entry);
5410-
54115403
// Depend on vISA information about barriers presence to make sure that it's
54125404
// always set properly, even if a barrier is used as a part of Inline vISA
54135405
// code only.

IGC/Compiler/CISACodeGen/CheckInstrTypes.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,6 @@ bool CheckInstrTypes::runOnFunction(Function &F) {
8989
context = getAnalysis<CodeGenContextWrapper>().getCodeGenContext();
9090

9191
LI = &getAnalysis<LoopInfoWrapperPass>().getLoopInfo();
92-
if (g_metrics)
93-
context->metrics.CollectLoops(LI);
9492

9593
// check if module has debug info
9694
g_InstrTypes.hasDebugInfo = F.getParent()->getNamedMetadata("llvm.dbg.cu") != nullptr;

IGC/Compiler/CISACodeGen/DebugInfo.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -238,9 +238,6 @@ bool DebugInfoPass::runOnModule(llvm::Module &M) {
238238
currShader->ProgramOutput()->m_debugDataGenISASize = 0;
239239
currShader->ProgramOutput()->m_debugDataGenISA = nullptr;
240240

241-
m_currShader->GetContext()->metrics.CollectDataFromDebugInfo(m_currShader->entry, &m_currShader->GetDebugInfoData(),
242-
&VisaDbgInfo);
243-
244241
if (finalize) {
245242
IDebugEmitter::Release(m_pDebugEmitter);
246243
}

IGC/Compiler/CISACodeGen/Emu64OpsPass.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -578,12 +578,10 @@ bool Emu64Ops::expandInsts(Function &F) {
578578
for (auto BI = BB->begin(), BE = BB->end(); BI != BE; /*EMPTY*/) {
579579
Instruction *I = &(*BI++);
580580
doNotDeleteInstr = false;
581-
CGC->metrics.StatBeginEmuFunc(I);
582581
bool LocalChanged = Expander->expand(I);
583582
Changed |= LocalChanged;
584583

585584
if (LocalChanged) {
586-
CGC->metrics.StatEndEmuFunc(I);
587585
BI = std::next(BasicBlock::iterator(I));
588586
BE = I->getParent()->end();
589587
DeadInsts.insert(I);

IGC/Compiler/CISACodeGen/LowerGEPForPrivMem.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -724,9 +724,6 @@ void LowerGEPForPrivMem::visitAllocaInst(AllocaInst &I) {
724724
IGC_ASSERT(I.getType()->getAddressSpace() == ADDRESS_SPACE_PRIVATE);
725725

726726
StatusPrivArr2Reg status = CheckIfAllocaPromotable(&I);
727-
if (I.getType()->getAddressSpace() == ADDRESS_SPACE_PRIVATE) {
728-
m_ctx->metrics.CollectMem2Reg(&I, status);
729-
}
730727
if (status != StatusPrivArr2Reg::OK) {
731728
MarkNotPromtedAllocas(I, status);
732729
// alloca size extends remain per-lane-reg space

IGC/Compiler/CISACodeGen/PartialEmuI64OpsPass.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -708,12 +708,10 @@ bool PartialEmuI64Ops::expandInsts(Function &F) {
708708
for (auto &BB : RPOT) {
709709
for (auto BI = BB->begin(), BE = BB->end(); BI != BE; /*EMPTY*/) {
710710
Instruction *I = &(*BI++);
711-
CGC->metrics.StatBeginEmuFunc(I);
712711
bool LocalChanged = Expander->expand(I);
713712
Changed |= LocalChanged;
714713

715714
if (LocalChanged) {
716-
CGC->metrics.StatEndEmuFunc(I);
717715
BI = std::next(BasicBlock::iterator(I));
718716
BE = I->getParent()->end();
719717
DeadInsts.insert(I);

IGC/Compiler/CISACodeGen/PatternMatchPass.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1262,11 +1262,6 @@ void CodeGenPatternMatch::visitCallInst(CallInst &I) {
12621262
} else {
12631263
Function *Callee = I.getCalledFunction();
12641264

1265-
if (IGCMetrics::IGCMetric::isMetricFuncCall(&I)) {
1266-
// dont do anything with metrics calls
1267-
return;
1268-
}
1269-
12701265
// Match inline asm
12711266
if (I.isInlineAsm()) {
12721267
if (getAnalysis<CodeGenContextWrapper>().getCodeGenContext()->m_DriverInfo.SupportInlineAssembly()) {

0 commit comments

Comments
 (0)