Skip to content

Commit 06a755f

Browse files
fda0igcbot
authored andcommitted
IIGC and vISA refactors
This commit contains mostly refactors and few minor fixes. Refactors related to passing arguments through references and rule of three. Fixes `,` omission in `visa/G4_IR.cpp`.
1 parent ab205c8 commit 06a755f

Some content is hidden

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

53 files changed

+90
-75
lines changed

IGC/AdaptorOCL/SPIRV/SPIRVInternal.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -927,7 +927,7 @@ void decorateSPIRVExtInst(std::string &S, std::vector<Type*> ArgTypes);
927927
bool isFunctionBuiltin(llvm::Function* F);
928928

929929
/// Get a canonical function name for a SPIR-V op code.
930-
std::string getSPIRVBuiltinName(Op OC, SPIRVInstruction *BI, std::vector<Type*> ArgTypes, std::string suffix);
930+
std::string getSPIRVBuiltinName(Op OC, SPIRVInstruction *BI, std::vector<Type*> ArgTypes, const std::string& suffix);
931931

932932
/// Mutates function call instruction by changing the arguments.
933933
/// \param ArgMutate mutates the function arguments.

IGC/AdaptorOCL/SPIRV/SPIRVReader.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4604,7 +4604,7 @@ SPIRVToLLVM::transAddressingModel() {
46044604

46054605
static llvm::MDNode*
46064606
transDecorationsToMetadataList(llvm::LLVMContext* Context,
4607-
std::vector<SPIRVDecorate const*> Decorates) {
4607+
const std::vector<SPIRVDecorate const*>& Decorates) {
46084608
SmallVector<Metadata*, 4> MDs;
46094609
MDs.reserve(Decorates.size());
46104610
for (const auto* Deco : Decorates) {
@@ -4783,7 +4783,7 @@ static void convertAnnotaionsToAttributes(llvm::Function *F, const std::vector<s
47834783
::isspace),
47844784
numThreadPerEU.end());
47854785

4786-
F->addFnAttr("num-thread-per-eu", numThreadPerEU == "auto" ? "0" : numThreadPerEU);
4786+
F->addFnAttr("num-thread-per-eu", numThreadPerEU == "auto" ? "0" : std::move(numThreadPerEU));
47874787
}
47884788
}
47894789
}

IGC/AdaptorOCL/SPIRV/SPIRVUtil.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ isFunctionBuiltin(llvm::Function* F) {
274274
}
275275

276276
std::string
277-
getSPIRVBuiltinName(Op OC, SPIRVInstruction *BI, std::vector<Type*> ArgTypes, std::string suffix) {
277+
getSPIRVBuiltinName(Op OC, SPIRVInstruction *BI, std::vector<Type*> ArgTypes, const std::string& suffix) {
278278
std::string name = OCLSPIRVBuiltinMap::map(OC);
279279

280280
if (!name.empty()) {

IGC/Compiler/CISACodeGen/CVariable.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,8 @@ namespace IGC {
205205
{
206206
}
207207

208+
CVariable& operator=(const CVariable&) = delete;
209+
208210
e_alignment GetAlign() const
209211
{
210212
IGC_ASSERT_MESSAGE(!m_isImmediate, "Calling GetAlign() on an immediate returns undefined result");

IGC/Compiler/CISACodeGen/CheckInstrTypes.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ namespace IGC
2525

2626
class CheckInstrTypes : public llvm::FunctionPass, public llvm::InstVisitor<CheckInstrTypes>
2727
{
28-
llvm::LoopInfo* LI;
28+
llvm::LoopInfo* LI = nullptr;
2929

3030
public:
3131
static char ID;

IGC/Compiler/CISACodeGen/CodeSinking.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1702,7 +1702,7 @@ namespace IGC {
17021702
if (j == je) {
17031703
// No match found, create the new one.
17041704
OperandUseGroup &OUG = AllGroups[i];
1705-
OUG.Operands = theUses;
1705+
OUG.Operands = std::move(theUses);
17061706
OUG.Users.push_back(I);
17071707
InstUseInfo.push_back(&OUG);
17081708
}

IGC/Compiler/CISACodeGen/EmitVISAPass.cpp

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21025,14 +21025,11 @@ LSC_CACHE_OPTS EmitPass::translateLSCCacheControlsFromMetadata(
2102521025
return cacheOpts;
2102621026
}
2102721027

21028-
if (inst)
21028+
const MDNode* node = inst ? inst->getMetadata("lsc.cache.ctrl") : nullptr;
21029+
if (node)
2102921030
{
21030-
const MDNode* node = inst ? inst->getMetadata("lsc.cache.ctrl") : nullptr;
21031-
if (node)
21032-
{
21033-
ConstantAsMetadata* MD = cast<ConstantAsMetadata>(node->getOperand(0));
21034-
cacheOpts = translateLSCCacheControlsFromValue(MD->getValue(), isLoad);
21035-
}
21031+
ConstantAsMetadata* MD = cast<ConstantAsMetadata>(node->getOperand(0));
21032+
cacheOpts = translateLSCCacheControlsFromValue(MD->getValue(), isLoad);
2103621033
}
2103721034
}
2103821035

IGC/Compiler/CISACodeGen/GenIRLowering.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,7 @@ bool GEPLowering::simplifyGEP(BasicBlock &BB) const {
513513
Exprs.emplace_back(PointerExpr{GEP, E, BaseWithMinDiff, Offset});
514514
}
515515
std::vector<Instruction *> DeadInsts;
516-
for (auto B : Pointers) {
516+
for (const auto& B : Pointers) {
517517
for (auto PI = B.second.rbegin(),
518518
PE = B.second.rend(); PI != PE; ++PI) {
519519
auto &P = *PI;

IGC/Compiler/CISACodeGen/LowerGEPForPrivMem.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ StatusPrivArr2Reg LowerGEPForPrivMem::CheckIfAllocaPromotable(llvm::AllocaInst*
351351
// subtract impact from GEP operations related to alloca from the register pressure
352352
// since after promotion alloca to register these GEPs will be eliminated
353353
unsigned int GEPImpact = 0;
354-
for (auto GEPinst : GEPliveranges)
354+
for (const auto& GEPinst : GEPliveranges)
355355
{
356356
if (GEPinst.LR->contains(i))
357357
GEPImpact += GEPinst.varSize;
@@ -361,7 +361,7 @@ StatusPrivArr2Reg LowerGEPForPrivMem::CheckIfAllocaPromotable(llvm::AllocaInst*
361361
pressure = std::max(pressure, RPinst - GEPImpact);
362362
}
363363

364-
for (auto it : m_promotedLiveranges)
364+
for (const auto& it : m_promotedLiveranges)
365365
{
366366
// check interval intersection
367367
if ((it.lowId < lowestAssignedNumber && it.highId > lowestAssignedNumber) ||

IGC/Compiler/CISACodeGen/MemOpt.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -692,7 +692,7 @@ bool MemOpt::removeRedBlockRead(GenIntrinsicInst* LeadingBlockRead,
692692
Value* subgroupLocalInvocationId = nullptr;
693693

694694
//Go through the collected blockreads to replace them with shuffles
695-
for (auto ITuple : BlockReadToRemove) {
695+
for (const auto& ITuple : BlockReadToRemove) {
696696
Instruction* I = std::get<0>(ITuple);
697697

698698
if (BlockReadToOptimize != I) {
@@ -4686,7 +4686,7 @@ void LdStCombine::createCombinedStores(Function& F)
46864686
// 1. set nontemporal if any merged store has it (make sense?)
46874687
SmallVector<std::pair<unsigned, llvm::MDNode*>, 4> MDs;
46884688
leadStore->getAllMetadata(MDs);
4689-
for (auto MII : MDs) {
4689+
for (const auto& MII : MDs) {
46904690
finalStore->setMetadata(MII.first, MII.second);
46914691
}
46924692

IGC/Compiler/CISACodeGen/OpenCLKernelCodeGen.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,15 +258,15 @@ namespace IGC
258258

259259
//check if option is set to use certain GRF size
260260
auto FuncName = pFunc->getName().str();
261-
for (auto SubNameR : ctx->m_Options.RegularGRFKernels)
261+
for (const auto& SubNameR : ctx->m_Options.RegularGRFKernels)
262262
{
263263
if (FuncName.find(SubNameR) != std::string::npos)
264264
{
265265
m_regularGRFRequested = true;
266266
break;
267267
}
268268
}
269-
for (auto SubNameL : ctx->m_Options.LargeGRFKernels)
269+
for (const auto& SubNameL : ctx->m_Options.LargeGRFKernels)
270270
{
271271
if (FuncName.find(SubNameL) != std::string::npos)
272272
{

IGC/Compiler/CISACodeGen/OpenCLKernelCodeGen.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ namespace IGC
7777

7878

7979
// Logic for native ZEBin support
80-
auto supportsZEBin = [&](CPlatform platformInfo)
80+
auto supportsZEBin = [&](const CPlatform& platformInfo)
8181
{
8282
switch (platformInfo.GetProductFamily())
8383
{

IGC/Compiler/CISACodeGen/PruneUnusedArguments.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ bool PruneUnusedArguments::runOnModule(Module& M) {
9595
CallInst* CI = dyn_cast<CallInst>(U);
9696
if (!CI)
9797
continue;
98-
for (auto Item : UnusedArgs) {
98+
for (const auto& Item : UnusedArgs) {
9999
auto Arg = Item.first;
100100
auto Index = Item.second;
101101
if (!isa<UndefValue>(CI->getArgOperand(Index))) {

IGC/Compiler/CISACodeGen/PushAnalysis.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ namespace IGC
456456
PushInfo& pushInfo = m_context->getModuleMetaData()->pushInfo;
457457

458458
// then check for static flag so that we can do push safely
459-
for (auto it : pushInfo.pushableAddresses)
459+
for (const auto& it : pushInfo.pushableAddresses)
460460
{
461461
if (runtimeval0 * 4 != it.addressOffset)
462462
{
@@ -1657,7 +1657,7 @@ namespace IGC
16571657
// Update IGC Metadata and shaders map
16581658
// Function declarations are changing, this needs to be reflected in the metadata.
16591659
MetadataBuilder mbuilder(&M);
1660-
for (auto i : funcsMapping)
1660+
for (const auto& i : funcsMapping)
16611661
{
16621662
IGCMD::IGCMetaDataHelper::moveFunction(
16631663
*m_pMdUtils, *m_context->getModuleMetaData(), i.first, i.second);

IGC/Compiler/CISACodeGen/RuntimeValueLegalizationPass.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ static void GetDisjointRegions(
144144
// ->{ {6, 6}, RuntimeValue* }
145145
// ->{ {8, 19}, RuntimeValue* }
146146
// { {8, 8}, RuntimeValue* }
147-
for (auto it : runtimeValueCalls)
147+
for (const auto& it : runtimeValueCalls)
148148
{
149149
std::pair<uint32_t, uint32_t> range = it.first;
150150
if (disjointRegions.empty() ||
@@ -286,7 +286,7 @@ bool RuntimeValueLegalizationPass::runOnModule(llvm::Module& module)
286286
GetAccessedRegions(accessedRegions, runtimeValueCalls, dataGRFAlignmentInDwords);
287287

288288
// Loop through all RuntimeValue calls
289-
for (auto it : runtimeValueCalls)
289+
for (const auto& it : runtimeValueCalls)
290290
{
291291
llvm::CallInst* callToResolve = llvm::cast<llvm::CallInst>(it.second);
292292

IGC/Compiler/CISACodeGen/ShaderCodeGen.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1115,7 +1115,7 @@ bool SimdEarlyCheck(CodeGenContext* ctx)
11151115

11161116
void destroyShaderMap(CShaderProgram::KernelShaderMap& shaders)
11171117
{
1118-
for (auto i : shaders)
1118+
for (const auto& i : shaders)
11191119
{
11201120
CShaderProgram* shader = i.second;
11211121
COMPILER_SHADER_STATS_PRINT(shader->m_shaderStats,

IGC/Compiler/CISACodeGen/SinkCommonOffsetFromGEP.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ bool DivergentPointersGroups::createAddNewGroups(const DivergentPointer& DP) {
290290
void DivergentPointersGroups::add(const DivergentPointer& DP) {
291291
// Check all GEPs without last index have the same type
292292
SmallVector<Type*, 2> Types;
293-
for (auto IT : DP.Geps) {
293+
for (const auto& IT : DP.Geps) {
294294
GetElementPtrInst* GEP = IT.second.GEP;
295295
SmallVector<Value*, 2> IdxList { GEP->idx_begin(), GEP->idx_end() - 1 };
296296
auto Type = GetElementPtrInst::getIndexedType(GEP->getSourceElementType(), IdxList);
@@ -405,7 +405,7 @@ static bool sinkCommonOffsetForGroup(const CommonBaseGroup& Group) {
405405
auto OffsetGEP = GetElementPtrInst::Create(OffsetType, BasePhi, Indices, "", BasePhi->getNextNonDebugInstruction());
406406

407407
bool isInBounds = false;
408-
for (auto Gep : Geps)
408+
for (const auto& Gep : Geps)
409409
isInBounds |= Gep.second.GEP->isInBounds();
410410
OffsetGEP->setIsInBounds(isInBounds);
411411

IGC/Compiler/CISACodeGen/helper.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -908,7 +908,7 @@ namespace IGC
908908
// Make sure constant folding is safe by looking up in pushableAddresses
909909
PushInfo& pushInfo = pContext->getModuleMetaData()->pushInfo;
910910

911-
for (auto it : pushInfo.pushableAddresses)
911+
for (const auto& it : pushInfo.pushableAddresses)
912912
{
913913
if ((bufIdOrGRFOffset * 4 == it.addressOffset) && (IGC_IS_FLAG_ENABLED(DisableStaticCheckForConstantFolding) || it.isStatic))
914914
{
@@ -2949,7 +2949,7 @@ bool PDT_dominates(llvm::PostDominatorTree& PTD,
29492949
// are not necessarily trivially dead. For example, store instruction.
29502950
void RecursivelyDeleteDeadInstructions(
29512951
Instruction * I, const TargetLibraryInfo * TLI, MemorySSAUpdater * MSSAU,
2952-
std::function<void(Value*)> AboutToDeleteCallback) {
2952+
const std::function<void(Value*)>& AboutToDeleteCallback) {
29532953
SmallVector<Instruction*, 16> DeadInsts;
29542954
DeadInsts.push_back(I);
29552955
RecursivelyDeleteDeadInstructions(DeadInsts, TLI, MSSAU,
@@ -2961,7 +2961,7 @@ void RecursivelyDeleteDeadInstructions(
29612961
const SmallVectorImpl<Instruction*>&DeadInsts,
29622962
const TargetLibraryInfo * TLI,
29632963
MemorySSAUpdater * MSSAU,
2964-
std::function<void(Value*)> AboutToDeleteCallback) {
2964+
const std::function<void(Value*)>& AboutToDeleteCallback) {
29652965
#if LLVM_VERSION_MAJOR < 11
29662966
SmallVector<Instruction*, 16> trivialDeadInsts;
29672967
#else

IGC/Compiler/CISACodeGen/helper.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -609,13 +609,13 @@ namespace IGC
609609
llvm::Instruction* I,
610610
const llvm::TargetLibraryInfo* TLI = nullptr,
611611
llvm::MemorySSAUpdater* MSSAU = nullptr,
612-
std::function<void(llvm::Value*)> AboutToDeleteCallback =
612+
const std::function<void(llvm::Value*)>& AboutToDeleteCallback =
613613
std::function<void(llvm::Value*)>());
614614

615615
void RecursivelyDeleteDeadInstructions(
616616
const llvm::SmallVectorImpl<llvm::Instruction*>& DeadInsts,
617617
const llvm::TargetLibraryInfo* TLI = nullptr,
618618
llvm::MemorySSAUpdater* MSSAU = nullptr,
619-
std::function<void(llvm::Value*)> AboutToDeleteCallback =
619+
const std::function<void(llvm::Value*)>& AboutToDeleteCallback =
620620
std::function<void(llvm::Value*)>());
621621
} // namespace IGC

IGC/Compiler/GenTTI.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,9 +286,9 @@ namespace llvm {
286286

287287
// Find at least one base address, such that all loads
288288
// from it can be replaced by registers
289-
for (auto LIIterator : LoadInstructions) {
289+
for (const auto& LIIterator : LoadInstructions) {
290290
bool Found = true;
291-
for (auto LI : LIIterator.second)
291+
for (const auto& LI : LIIterator.second)
292292
Found &= canReplaceWithRegisters(LI, L, SE);
293293
if (Found) {
294294
UP.UpperBound = true;

IGC/Compiler/Optimizer/BuiltInFuncImport.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ static std::string updatedMangleName(const std::string& FuncName, const std::str
186186
static std::string updateSPIRmangleName(StringRef FuncName, const MangleSubstTy& MangleSubst)
187187
{
188188
std::string NewNameStr = FuncName.str();
189-
for (auto Key : MangleSubst)
189+
for (const auto& Key : MangleSubst)
190190
{
191191
auto Mangle = Key.first.str();
192192
auto NewMangle = Key.second.str();
@@ -873,7 +873,7 @@ bool BIImport::runOnModule(Module& M)
873873
IGC_ASSERT(subgroup_size != 0);
874874

875875
// Parse each variant string in the table, stop at the first one that matches subgroup_size
876-
for (auto var : VariantsTable)
876+
for (const auto& var : VariantsTable)
877877
{
878878
// We only need to get the SIMD size from the string
879879
auto [symStr, fName, vecLen] = IGC::ParseVectorVariantFunctionString(var);
@@ -1457,7 +1457,7 @@ bool PreBIImportAnalysis::runOnModule(Module& M)
14571457
(float) value));
14581458
}
14591459

1460-
for (auto CIPair : CallToReplace)
1460+
for (const auto& CIPair : CallToReplace)
14611461
{
14621462
auto oldCI = CIPair.first;
14631463
auto newCI = CIPair.second;

IGC/Compiler/Optimizer/IndirectCallOptimization.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ namespace IGC
200200
{
201201
IRB.SetInsertPoint(&*(endBlock->begin()));
202202
PHINode* phi = IRB.CreatePHI(CI.getType(), callToBBPair.size());
203-
for (auto it : callToBBPair)
203+
for (const auto& it : callToBBPair)
204204
{
205205
phi->addIncoming(it.first, it.second);
206206
}

IGC/Compiler/Optimizer/OpenCLPasses/GenericAddressResolution/LowerGPCallArg.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ std::optional<unsigned> LowerGPCallArg::getOriginAddressSpace(Function* func, un
208208
// Loops over the argument list transferring uses from old function to new one.
209209
void LowerGPCallArg::updateFunctionArgs(Function* oldFunc, Function* newFunc)
210210
{
211-
for (auto ArgPair : llvm::zip(oldFunc->args(), newFunc->args()))
211+
for (const auto& ArgPair : llvm::zip(oldFunc->args(), newFunc->args()))
212212
{
213213
Value* oldArg = &std::get<0>(ArgPair);
214214
Value* newArg = &std::get<1>(ArgPair);

IGC/Compiler/Optimizer/OpenCLPasses/OpenCLPrintf/OpenCLPrintfResolution.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ std::string OpenCLPrintfResolution::getPrintfStringsMDNodeName(Function& F)
367367
return "printf.strings";
368368
}
369369

370-
static StoreInst* genStoreInternal(Value* Val, Value* Ptr, BasicBlock* InsertAtEnd, DebugLoc DL, bool isNontemporal)
370+
static StoreInst* genStoreInternal(Value* Val, Value* Ptr, BasicBlock* InsertAtEnd, const DebugLoc& DL, bool isNontemporal)
371371
{
372372
bool isVolatile = false;
373373
unsigned Align = 4;

IGC/Compiler/Optimizer/OpenCLPasses/ScalarArgAsPointer/ScalarArgAsPointer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ bool ScalarArgAsPointerAnalysis::findStoredArgs(llvm::LoadInst& LI, ArgSet& args
295295
for (auto it = offsets.begin(); it != offsets.end(); ++it)
296296
tmp.push_back(*it + i * byteSize);
297297

298-
offsets = tmp;
298+
offsets = std::move(tmp);
299299
}
300300
}
301301
}

IGC/Compiler/Optimizer/OpenCLPasses/StatelessToStateful/StatelessToStateful.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ Argument* StatelessToStateful::getBufferOffsetArg(Function* F, uint32_t ArgNumbe
225225
// The final instruction of the expansion is returned in 'offset'
226226
//
227227
bool StatelessToStateful::getOffsetFromGEP(
228-
Function* F, SmallVector<GetElementPtrInst*, 4> GEPs,
228+
Function* F, const SmallVector<GetElementPtrInst*, 4>& GEPs,
229229
uint32_t argNumber, bool isImplicitArg, Value*& offset)
230230
{
231231
Module* M = F->getParent();

IGC/Compiler/Optimizer/OpenCLPasses/StatelessToStateful/StatelessToStateful.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ namespace IGC
114114
bool pointerIsFromKernelArgument(llvm::Value& ptr);
115115

116116
bool getOffsetFromGEP(
117-
llvm::Function* F, llvm::SmallVector<llvm::GetElementPtrInst*, 4> GEPs,
117+
llvm::Function* F, const llvm::SmallVector<llvm::GetElementPtrInst*, 4>& GEPs,
118118
uint32_t argNumber, bool isImplicitArg, llvm::Value*& offset);
119119
llvm::Argument* getBufferOffsetArg(llvm::Function* F, uint32_t ArgNumber);
120120
void setPointerSizeTo32bit(int32_t AddrSpace, llvm::Module* M);

IGC/Compiler/Optimizer/SynchronizationObjectCoalescing.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1174,7 +1174,7 @@ static void SearchInstructions(
11741174
}
11751175
};
11761176

1177-
for (auto it : workList)
1177+
for (const auto& it : workList)
11781178
{
11791179
const llvm::BasicBlock* pCurrentBasicBlock = it->getParent();
11801180
// use the iterator only if it wasn't visited or restricted

IGC/DebugInfo/DIE.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -528,6 +528,7 @@ void DIEBlock::EmitValue(StreamEmitter *Asm, dwarf::Form Form) const {
528528
switch (Form) {
529529
default:
530530
IGC_ASSERT_EXIT_MESSAGE(0, "Improper form for block");
531+
break;
531532
case dwarf::DW_FORM_block1:
532533
Asm->EmitInt8(Size);
533534
break;

IGC/DebugInfo/StreamEmitter.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ class StreamEmitter {
5757

5858
/// @brief Destructor.
5959
~StreamEmitter();
60+
StreamEmitter(const StreamEmitter &) = delete;
61+
StreamEmitter &operator=(const StreamEmitter &) = delete;
6062

6163
const Settings &GetEmitterSettings() const { return StreamOptions; };
6264

IGC/common/ShaderOverride.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,6 @@ void overrideShaderIGA(PLATFORM const & platform, void *& genxbin, int & binSize
256256
fIGAReleaseContext = (pIGAReleaseContext)GetProcAddress(hModule, IGA_RELEASE_CONTEXT_STR);
257257

258258
if (fCreateContext == nullptr ||
259-
fCreateContext == nullptr ||
260259
fIGAGetErrors == nullptr ||
261260
fIGAGetWarnings == nullptr ||
262261
fIGADiagnosticGetMessage == nullptr ||

0 commit comments

Comments
 (0)