Skip to content

Commit 2dccc4d

Browse files
Kotynia, Piotrigcbot
authored andcommitted
Debug info refactoring
General debug info refactoring. 1. IGC/Compiler/DebugInfo/ files moved to IGC/DebugInfo 2. Utils files merged 3. ScalarVISAModule -> VISAScalarModule and DebugInfoData -> CShaderDebugInfo rename 4. DebugInfoData::markOutput.. renamed 5. DebugInfoPass modularized and cleaned from unrelated functions. 6. General dirty code cleanup.
1 parent 7eff323 commit 2dccc4d

Some content is hidden

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

47 files changed

+2047
-2043
lines changed

IGC/AdaptorCommon/AddImplicitArgs.cpp

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,38 @@
11
/*========================== begin_copyright_notice ============================
22
3-
Copyright (C) 2017-2021 Intel Corporation
3+
Copyright (C) 2017-2023 Intel Corporation
44
55
SPDX-License-Identifier: MIT
66
77
============================= end_copyright_notice ===========================*/
88

99
#include "AddImplicitArgs.hpp"
1010
#include "AdaptorCommon/ImplicitArgs.hpp"
11-
#include "Compiler/IGCPassSupport.h"
1211
#include "Compiler/CISACodeGen/CISACodeGen.h"
1312
#include "Compiler/CISACodeGen/OpenCLKernelCodeGen.hpp"
14-
#include "Compiler/DebugInfo/ScalarVISAModule.h"
15-
#include "Compiler/Optimizer/OCLBIUtils.h"
13+
#include "Compiler/IGCPassSupport.h"
1614
#include "Compiler/MetaDataApi/IGCMetaDataHelper.h"
15+
#include "Compiler/Optimizer/OCLBIUtils.h"
16+
#include "DebugInfo/VISADebugEmitter.hpp"
17+
#include "Compiler/ScalarDebugInfo/VISAScalarModule.hpp"
1718
#include "LLVM3DBuilder/MetadataBuilder.h"
19+
#include "Probe/Assertion.h"
20+
#include "common/debug/Debug.hpp"
21+
1822
#include "common/LLVMWarningsPush.hpp"
19-
#include "llvm/ADT/SCCIterator.h"
20-
#include <llvm/IR/Module.h>
23+
#include <llvm/ADT/SCCIterator.h>
24+
#include <llvm/IR/DIBuilder.h>
25+
#include <llvm/ADT/DepthFirstIterator.h>
26+
#include <llvm/IR/DerivedTypes.h>
2127
#include <llvm/IR/Function.h>
28+
#include <llvm/IR/Instructions.h>
29+
#include <llvm/IR/Module.h>
2230
#include <llvmWrapper/ADT/STLExtras.h>
2331
#include <llvmWrapper/IR/Instructions.h>
24-
#include <llvm/IR/Instructions.h>
25-
#include <llvm/IR/DerivedTypes.h>
26-
#include "llvm/IR/DIBuilder.h"
27-
#include <llvm/ADT/DepthFirstIterator.h>
2832
#include "common/LLVMWarningsPop.hpp"
29-
#include "common/debug/Debug.hpp"
30-
#include "DebugInfo/VISADebugEmitter.hpp"
33+
3134
#include <map>
3235
#include <utility>
33-
#include <iostream>
34-
#include "Probe/Assertion.h"
3536

3637
using namespace llvm;
3738
using namespace IGC;

IGC/AdaptorOCL/OCL/sp/spp_g8.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*========================== begin_copyright_notice ============================
22
3-
Copyright (C) 2017-2021 Intel Corporation
3+
Copyright (C) 2017-2023 Intel Corporation
44
55
SPDX-License-Identifier: MIT
66
@@ -482,7 +482,9 @@ bool CGen8OpenCLProgram::GetZEBinary(
482482
// containing mapping between temp name and 'usual' kernel name.
483483
//
484484
// JSON file is created if IGC_ElfTempDumpEnable is enabled.
485-
std::list<string> elfVecNames; // List of parameters for the linker, contains in/out ELF file names and params
485+
486+
// List of parameters for the linker, contains in/out ELF file names and params
487+
std::list<std::string> elfVecNames;
486488
std::vector<const char*> elfVecPtrs; // Vector of pointers to the elfVecNames vector elements
487489

488490
const unsigned int maxElfFileNameLength = 512;

IGC/AdaptorOCL/UnifyIROCL.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*========================== begin_copyright_notice ============================
22
3-
Copyright (C) 2017-2022 Intel Corporation
3+
Copyright (C) 2017-2023 Intel Corporation
44
55
SPDX-License-Identifier: MIT
66
@@ -139,9 +139,9 @@ SPDX-License-Identifier: MIT
139139

140140
#include "Compiler/CISACodeGen/DebugInfo.hpp"
141141
#include "Compiler/CISACodeGen/TimeStatsCounter.h"
142-
#include "Compiler/DebugInfo/ScalarVISAModule.h"
143-
#include "Compiler/DebugInfo/Utils.h"
142+
#include "DebugInfo/Utils.hpp"
144143
#include "DebugInfo/VISADebugEmitter.hpp"
144+
#include "Compiler/ScalarDebugInfo/VISAScalarModule.hpp"
145145

146146
#include <string>
147147
#include <algorithm>

IGC/Compiler/CISACodeGen/CISABuilder.cpp

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*========================== begin_copyright_notice ============================
22
3-
Copyright (C) 2017-2022 Intel Corporation
3+
Copyright (C) 2017-2023 Intel Corporation
44
55
SPDX-License-Identifier: MIT
66
@@ -6627,8 +6627,8 @@ namespace IGC
66276627
float threshold = 0.0f;
66286628
bool noRetryForStack = true;
66296629
std::stringstream ss;
6630-
ss << endl << "Stack Function Spill Info:" << endl;
6631-
ss << "KERNEL: " << m_program->entry->getName().str() << endl;
6630+
ss << std::endl << "Stack Function Spill Info:" << std::endl;
6631+
ss << "KERNEL: " << m_program->entry->getName().str() << std::endl;
66326632
if (m_program->m_spillCost > threshold || context->HasFuncExpensiveLoop(m_program->entry))
66336633
{
66346634
// First check the kernel
@@ -6647,7 +6647,7 @@ namespace IGC
66476647
{
66486648
// Check each stackcall function
66496649
noRetryForStack = false;
6650-
string FName = StripCloneName(func.first->getName().str());
6650+
std::string FName = StripCloneName(func.first->getName().str());
66516651
context->m_retryManager.PerFuncRetrySet.insert(FName);
66526652
ss << " STACK_FUNC Retry: " << FName << std::endl;
66536653
ss << " HasFuncExpensiveLoop = " << context->HasFuncExpensiveLoop(func.first) << std::endl;
@@ -6673,8 +6673,8 @@ namespace IGC
66736673
continue;
66746674

66756675
Function* SGH = pFGA->getSubGroupMap(F);
6676-
string FName = StripCloneName(F->getName().str());
6677-
string SGHName = StripCloneName(SGH->getName().str());
6676+
std::string FName = StripCloneName(F->getName().str());
6677+
std::string SGHName = StripCloneName(SGH->getName().str());
66786678
if (context->m_retryManager.PerFuncRetrySet.count(SGHName) != 0)
66796679
{
66806680
noRetryForStack = false;
@@ -6693,9 +6693,15 @@ namespace IGC
66936693
else if (!context->m_retryManager.IsLastTry())
66946694
{
66956695
if (IGC_GET_FLAG_VALUE(AllowStackCallRetry) == 1)
6696-
ss << "AllowStackCallRetry=1 (All functions in this kernel group will be retried with 2nd try states)" << endl << endl;
6696+
ss << "AllowStackCallRetry=1 (All functions in this kernel "
6697+
"group will be retried with 2nd try states)"
6698+
<< std::endl
6699+
<< std::endl;
66976700
else if (IGC_GET_FLAG_VALUE(AllowStackCallRetry) == 2)
6698-
ss << "AllowStackCallRetry=2 (Only the spilled functions will be retried with 2nd try states)" << endl << endl;
6701+
ss << "AllowStackCallRetry=2 (Only the spilled functions "
6702+
"will be retried with 2nd try states)"
6703+
<< std::endl
6704+
<< std::endl;
66996705
if (IGC_IS_FLAG_ENABLED(PrintStackCallDebugInfo))
67006706
dbgs() << ss.str() << "\n";
67016707
}

IGC/Compiler/CISACodeGen/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ set(IGC_BUILD__SRC__CISACodeGen_Common
3030
"${CMAKE_CURRENT_SOURCE_DIR}/ConstantCoalescing.cpp"
3131
"${CMAKE_CURRENT_SOURCE_DIR}/DeSSA.cpp"
3232
"${CMAKE_CURRENT_SOURCE_DIR}/DebugInfo.cpp"
33+
"${CMAKE_CURRENT_SOURCE_DIR}/CShaderDebugInfo.cpp"
3334
"${CMAKE_CURRENT_SOURCE_DIR}/DpasScan.cpp"
3435
"${CMAKE_CURRENT_SOURCE_DIR}/EmitVISAPass.cpp"
3536
"${CMAKE_CURRENT_SOURCE_DIR}/Emu64OpsPass.cpp"
@@ -122,7 +123,7 @@ set(IGC_BUILD__HDR__CISACodeGen_Common
122123
"${CMAKE_CURRENT_SOURCE_DIR}/ConstantCoalescing.hpp"
123124
"${CMAKE_CURRENT_SOURCE_DIR}/DeSSA.hpp"
124125
"${CMAKE_CURRENT_SOURCE_DIR}/DebugInfo.hpp"
125-
"${CMAKE_CURRENT_SOURCE_DIR}/DebugInfoData.hpp"
126+
"${CMAKE_CURRENT_SOURCE_DIR}/CShaderDebugInfo.hpp"
126127
"${CMAKE_CURRENT_SOURCE_DIR}/DpasScan.hpp"
127128
"${CMAKE_CURRENT_SOURCE_DIR}/DriverInfo.hpp"
128129
"${CMAKE_CURRENT_SOURCE_DIR}/EmitVISAPass.hpp"

IGC/Compiler/CISACodeGen/CShader.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*========================== begin_copyright_notice ============================
22
3-
Copyright (C) 2017-2022 Intel Corporation
3+
Copyright (C) 2017-2023 Intel Corporation
44
55
SPDX-License-Identifier: MIT
66
@@ -455,10 +455,7 @@ void CShader::CreateImplicitArgs()
455455
CreateAliasVars();
456456
}
457457

458-
DebugInfoData& IGC::CShader::GetDebugInfoData()
459-
{
460-
return diData;
461-
}
458+
CShaderDebugInfo &CShader::GetDebugInfoData() { return diData; }
462459

463460
// For sub-vector aliasing, pre-allocating cvariables for those
464461
// valeus that have sub-vector aliasing before emit instructions.
@@ -4163,3 +4160,7 @@ void CShader::getShaderFileName(std::string& ShaderName) const
41634160
}
41644161
return;
41654162
}
4163+
4164+
bool CShader::HasDebugInfo() const {
4165+
return GetContext()->m_instrTypes.hasDebugInfo;
4166+
}

0 commit comments

Comments
 (0)