Skip to content

Commit 8886ad2

Browse files
aparshin-inteligcbot
authored andcommitted
removed deprecated define
removed deprecated define
1 parent 1c7bc51 commit 8886ad2

File tree

10 files changed

+36
-36
lines changed

10 files changed

+36
-36
lines changed

IGC/AdaptorCommon/AddImplicitArgs.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -216,9 +216,9 @@ void AddImplicitArgs::updateNewFuncArgs(llvm::Function* pFunc, llvm::Function* p
216216
// the new arguments, also transferring over the names as well.
217217
std::vector<std::pair<llvm::Instruction*, unsigned int>> newAddr;
218218
bool fullDebugInfo = false;
219-
IF_DEBUG_INFO(bool lineNumbersOnly = false;)
220-
IF_DEBUG_INFO(CodeGenContext* ctx = getAnalysis<CodeGenContextWrapper>().getCodeGenContext();)
221-
IF_DEBUG_INFO(DebugMetadataInfo::hasAnyDebugInfo(ctx, fullDebugInfo, lineNumbersOnly);)
219+
bool lineNumbersOnly = false;
220+
CodeGenContext* ctx = getAnalysis<CodeGenContextWrapper>().getCodeGenContext();
221+
DebugMetadataInfo::hasAnyDebugInfo(ctx, fullDebugInfo, lineNumbersOnly);
222222

223223
if (fullDebugInfo)
224224
{
@@ -271,16 +271,16 @@ void AddImplicitArgs::updateNewFuncArgs(llvm::Function* pFunc, llvm::Function* p
271271
// storage location for the variable.
272272
for (auto toReplace : newAddr)
273273
{
274-
IF_DEBUG_INFO(auto d = dyn_cast<DbgDeclareInst>(toReplace.first);)
274+
auto d = dyn_cast<DbgDeclareInst>(toReplace.first);
275275

276-
IF_DEBUG_INFO(llvm::DIBuilder Builder(*pNewFunc->getParent()));
277-
IF_DEBUG_INFO(auto DIVar = d->getVariable();)
278-
IF_DEBUG_INFO(auto DIExpr = d->getExpression();)
276+
llvm::DIBuilder Builder(*pNewFunc->getParent());
277+
auto DIVar = d->getVariable();
278+
auto DIExpr = d->getExpression();
279279

280280
IGC_ASSERT(toReplace.second < pNewFunc->arg_size());
281-
IF_DEBUG_INFO(Value* v = pNewFunc->arg_begin() + toReplace.second);
282-
IF_DEBUG_INFO(Builder.insertDeclare(v, DIVar, DIExpr, d->getDebugLoc().get(), d);)
283-
IF_DEBUG_INFO(d->eraseFromParent();)
281+
Value* v = pNewFunc->arg_begin() + toReplace.second;
282+
Builder.insertDeclare(v, DIVar, DIExpr, d->getDebugLoc().get(), d);
283+
d->eraseFromParent();
284284
}
285285

286286
// Set implicit argument names

IGC/AdaptorOCL/UnifyIROCL.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ static void CommonOCLBasedPasses(
317317

318318
if(pContext->m_InternalOptions.KernelDebugEnable)
319319
{
320-
IF_DEBUG_INFO(mpm.add(new ImplicitGlobalId());)
320+
mpm.add(new ImplicitGlobalId());
321321
}
322322

323323
if (IGC_IS_FLAG_ENABLED(EnableCodeAssumption))
@@ -540,7 +540,7 @@ static void CommonOCLBasedPasses(
540540
// this function here, as opposed to beginning of this function,
541541
// is that unreferenced constants will be eliminated. So
542542
// debugger will not be able to query those variables.
543-
IF_DEBUG_INFO(insertOCLMissingDebugConstMetadata(pContext);)
543+
insertOCLMissingDebugConstMetadata(pContext);
544544

545545
COMPILER_TIME_END(pContext, TIME_UnificationPasses);
546546

IGC/Compiler/CISACodeGen/DebugInfo.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,9 +277,10 @@ bool DebugInfoPass::runOnModule(llvm::Module& M)
277277
void DebugInfoPass::EmitDebugInfo(bool finalize, DbgDecoder* decodedDbg,
278278
const std::vector<llvm::DISubprogram*>& DISubprogramNodes)
279279
{
280-
std::vector<char> buffer;
280+
IGC_ASSERT(m_pDebugEmitter);
281281

282-
IF_DEBUG_INFO_IF(m_pDebugEmitter, buffer = m_pDebugEmitter->Finalize(finalize, decodedDbg, DISubprogramNodes);)
282+
std::vector<char> buffer =
283+
m_pDebugEmitter->Finalize(finalize, decodedDbg, DISubprogramNodes);
283284

284285
if (!buffer.empty())
285286
{

IGC/Compiler/CISACodeGen/EmitVISAPass.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -824,8 +824,8 @@ bool EmitPass::runOnFunction(llvm::Function& F)
824824
DebugOpts.EnableRelocation = IGC_IS_FLAG_ENABLED(EnableRelocations) || DebugOpts.ZeBinCompatible;
825825
DebugOpts.EnforceAMD64Machine = IGC_IS_FLAG_ENABLED(DebugInfoEnforceAmd64EM) || DebugOpts.ZeBinCompatible;
826826
DebugOpts.EmitPrologueEnd = IGC_IS_FLAG_ENABLED(EmitPrologueEnd);
827-
IF_DEBUG_INFO(m_pDebugEmitter = IDebugEmitter::Create();)
828-
IF_DEBUG_INFO(m_pDebugEmitter->Initialize(std::move(vMod), DebugOpts);)
827+
m_pDebugEmitter = IDebugEmitter::Create();
828+
m_pDebugEmitter->Initialize(std::move(vMod), DebugOpts);
829829
}
830830

831831
if (DebugInfoData::hasDebugInfo(m_currShader))
@@ -1098,7 +1098,7 @@ bool EmitPass::runOnFunction(llvm::Function& F)
10981098
{
10991099
if (!m_currShader->GetDebugInfoData().m_pDebugEmitter)
11001100
{
1101-
IF_DEBUG_INFO(IDebugEmitter::Release(m_pDebugEmitter);)
1101+
IDebugEmitter::Release(m_pDebugEmitter);
11021102
}
11031103

11041104
if (!m_encoder->IsCodePatchCandidate() || m_encoder->HasPrevKernel())
@@ -8329,7 +8329,7 @@ void EmitPass::emitPSSGV(GenIntrinsicInst* inst)
83298329
{
83308330
CVariable* r1 = m_currShader->BitCast(psProgram->GetR1(), ISA_TYPE_UW);
83318331
temp = m_currShader->GetNewVariable(8, ISA_TYPE_UW, EALIGN_GRF,
8332-
std::string(IF_DEBUG_INFO("SampleIndexExtracted")));
8332+
"SampleIndexExtracted");
83338333
m_encoder->SetSrcRegion(0, 0, 1, 0);
83348334
m_encoder->SetSimdSize(SIMDMode::SIMD8);
83358335
m_encoder->SetNoMask();

IGC/Compiler/CISACodeGen/ShaderCodeGen.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1502,7 +1502,7 @@ void OptimizeIR(CodeGenContext* const pContext)
15021502
if (((OpenCLProgramContext*)pContext)->m_InternalOptions.KernelDebugEnable)
15031503
{
15041504
IGCPassManager mpm(pContext, "CleanImplicitId");
1505-
IF_DEBUG_INFO(mpm.add(new CleanImplicitIds()));
1505+
mpm.add(new CleanImplicitIds());
15061506
mpm.run(*pContext->getModule());
15071507
}
15081508
}

IGC/Compiler/Optimizer/OpenCLPasses/LocalBuffers/InlineLocalsResolution.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -449,14 +449,14 @@ void InlineLocalsResolution::collectInfoOnSharedLocalMem(Module& M)
449449
}
450450

451451
// set debugging info, and insert mov inst.
452-
IF_DEBUG_INFO(for (const auto& I : m_FuncToVarsMap))
452+
for (const auto& I : m_FuncToVarsMap)
453453
{
454-
IF_DEBUG_INFO(Function * userFunc = I.first;)
455-
IF_DEBUG_INFO(for (auto G : I.second))
454+
Function* userFunc = I.first;
455+
for (auto* G : I.second)
456456
{
457-
IF_DEBUG_INFO(Instruction * pInsertBefore = &(*userFunc->begin()->getFirstInsertionPt());)
458-
TODO("Should inline local buffer points to origin offset 'globalVar' or to fixed offset 'pMovedPtr'?");
459-
IF_DEBUG_INFO(Utils::UpdateGlobalVarDebugInfo(G, G, pInsertBefore, true););
457+
Instruction * pInsertBefore = &(*userFunc->begin()->getFirstInsertionPt());
458+
TODO("Should inline local buffer points to origin offset 'globalVar' or to fixed offset 'pMovedPtr'?");
459+
Utils::UpdateGlobalVarDebugInfo(G, G, pInsertBefore, true);
460460
}
461461
}
462462
}

IGC/Compiler/Optimizer/OpenCLPasses/PrivateMemory/PrivateMemoryResolution.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -842,8 +842,8 @@ bool PrivateMemoryResolution::resolveAllocaInstructions(bool privateOnStack)
842842
ImplicitArgs implicitArgs(*m_currFunction, m_pMdUtils);
843843

844844
// Construct an empty DebugLoc.
845-
IF_DEBUG_INFO(DebugLoc entryDebugLoc);
846-
IF_DEBUG_INFO(entryBuilder.SetCurrentDebugLocation(entryDebugLoc));
845+
DebugLoc entryDebugLoc;
846+
entryBuilder.SetCurrentDebugLocation(entryDebugLoc);
847847

848848
if (privateOnStack)
849849
{
@@ -855,7 +855,7 @@ bool PrivateMemoryResolution::resolveAllocaInstructions(bool privateOnStack)
855855
{
856856
bool isUniform = pAI->getMetadata("uniform") != nullptr;
857857
llvm::IRBuilder<> builder(pAI);
858-
IF_DEBUG_INFO(builder.SetCurrentDebugLocation(entryDebugLoc));
858+
builder.SetCurrentDebugLocation(entryDebugLoc);
859859

860860
// buffer of this private var
861861
Value* privateBuffer = nullptr;
@@ -988,7 +988,7 @@ bool PrivateMemoryResolution::resolveAllocaInstructions(bool privateOnStack)
988988
// correctly. So instead, we set DebugLoc for the instructions generated by lowering
989989
// alloca to mark that they are part of the prologue.
990990
// Note: As per Amjad, later LLVM version has a fix for this in llvm/lib/Transforms/Utils/InlineFunction.cpp.
991-
IF_DEBUG_INFO(builder.SetCurrentDebugLocation(pAI->getDebugLoc()));
991+
builder.SetCurrentDebugLocation(pAI->getDebugLoc());
992992

993993
// Get buffer information from the analysis
994994
unsigned int scalarBufferOffset = m_ModAllocaInfo->getConstBufferOffset(pAI);
@@ -1120,7 +1120,7 @@ bool PrivateMemoryResolution::resolveAllocaInstructions(bool privateOnStack)
11201120
// %privateBuffer = bitcast i8* %offsettmp1 to <buffer type>
11211121

11221122
llvm::IRBuilder<> builder(pAI);
1123-
IF_DEBUG_INFO(builder.SetCurrentDebugLocation(entryDebugLoc));
1123+
builder.SetCurrentDebugLocation(entryDebugLoc);
11241124
bool isUniform = pAI->getMetadata("uniform") != nullptr;
11251125
// Get buffer information from the analysis
11261126
unsigned int scalarBufferOffset = m_ModAllocaInfo->getConstBufferOffset(pAI);

IGC/Compiler/Optimizer/OpenCLPasses/PrivateMemory/PrivateMemoryToSLM.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ namespace IGC
217217

218218
// This declaration will invoke constructor of DebugLoc class
219219
// and result in an empty DebugLoc instance, ie with line and scope set to 0.
220-
IF_DEBUG_INFO(DebugLoc emptyDebugLoc);
220+
DebugLoc emptyDebugLoc;
221221

222222
LLVMContext& llvmCtx = F->getContext();
223223
IntegerType* typeInt32 = Type::getInt32Ty(llvmCtx);
@@ -292,7 +292,7 @@ namespace IGC
292292
// TODO: optimize on x-y-z values
293293
llvm::IRBuilder<> builder(pAI);
294294

295-
IF_DEBUG_INFO(builder.SetCurrentDebugLocation(emptyDebugLoc));
295+
builder.SetCurrentDebugLocation(emptyDebugLoc);
296296

297297
// totalOffset = localIdX +
298298
// localIdY * dimX +

IGC/Compiler/Optimizer/ValueTracker.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -182,9 +182,9 @@ Value* ValueTracker::handleGlobalVariable(GlobalVariable* G)
182182
Constant* pSamplerVal = G->getInitializer();
183183
// Add debug info intrinsic for this variable inside the function using this sampler.
184184
Instruction* pEntryPoint = &(*m_Function->getEntryBlock().getFirstInsertionPt());
185-
IF_DEBUG_INFO(Utils::UpdateGlobalVarDebugInfo(G, pSamplerVal, pEntryPoint, false);)
186-
// Found a global sampler, return it.
187-
return isa<ConstantStruct>(pSamplerVal) ?
185+
Utils::UpdateGlobalVarDebugInfo(G, pSamplerVal, pEntryPoint, false);
186+
// Found a global sampler, return it.
187+
return isa<ConstantStruct>(pSamplerVal) ?
188188
pSamplerVal->getAggregateElement(0U) : pSamplerVal;
189189
}
190190

IGC/common/debug/Debug.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,5 +50,4 @@ namespace IGC
5050
int getPointerSize(llvm::Module &M);
5151
}
5252

53-
#define IF_DEBUG_INFO(X) X
5453
#define IF_DEBUG_INFO_IF(C, X) if (C) { X }

0 commit comments

Comments
 (0)