Skip to content

Commit 1517055

Browse files
unboagablegfxbot
authored andcommitted
Internal refactor
Change-Id: Ie8eaee983c7b3d8b175d905061d1996723308f64
1 parent 1eb48c8 commit 1517055

File tree

6 files changed

+18
-11
lines changed

6 files changed

+18
-11
lines changed

IGC/Compiler/CISACodeGen/CISABuilder.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2508,7 +2508,7 @@ void CEncoder::SetFloatDenormMode(VISAKernel* vKernel, Float_DenormMode mode16,
25082508
VISA_VectorOpnd* src0_Opnd = nullptr;
25092509
VISA_VectorOpnd* src1_Opnd = nullptr;
25102510
VISA_VectorOpnd* dst_Opnd = nullptr;
2511-
VISA_GenVar* cr0_var;
2511+
VISA_GenVar* cr0_var = nullptr;
25122512
uint imm_data = 0;
25132513
if (mode16 == FLOAT_DENORM_RETAIN)
25142514
imm_data |= 0x400;

IGC/Compiler/CISACodeGen/CodeSinking.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -759,8 +759,8 @@ bool CodeSinking::checkCongruent(const InstPair& values,
759759
return false;
760760
}
761761
unsigned as = ld0->getPointerAddressSpace();
762-
unsigned bufId;
763-
bool directBuf;
762+
unsigned bufId = 0;
763+
bool directBuf = false;
764764
BufferType bufType = IGC::DecodeAS4GFXResource(as, directBuf, bufId);
765765
if (bufType != CONSTANT_BUFFER)
766766
{

IGC/Compiler/CISACodeGen/PatternMatchPass.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,8 @@ CodeGenPatternMatch::isFPToIntegerSatWithExactConstant(llvm::CastInst *I) {
503503
return std::make_tuple(nullptr, 0, ISA_TYPE_F);
504504
}
505505

506-
llvm::ConstantFP *CMin, *CMax;
506+
llvm::ConstantFP *CMin = nullptr;
507+
llvm::ConstantFP *CMax = nullptr;
507508
llvm::Value *X = nullptr;
508509

509510
if (!match(I->getOperand(0), m_ClampWithConstants(m_Value(X), CMin, CMax)))
@@ -627,7 +628,8 @@ CodeGenPatternMatch::isFPToUnsignedIntSatWithInexactConstant( llvm::SelectInst *
627628

628629
// Fold extra clamp.
629630
Value *X2 = nullptr;
630-
ConstantFP *CMin2, *CMax2;
631+
ConstantFP *CMin2 = nullptr;
632+
ConstantFP *CMax2 = nullptr;
631633
if (match(X, m_ClampWithConstants(m_Value(X2), CMin2, CMax2))) {
632634
if (CMin2 == FMin) {
633635
if (CMax2->isExactlyValue(255.0)) {
@@ -2529,7 +2531,7 @@ bool CodeGenPatternMatch::MatchSatModifier(llvm::Instruction& I)
25292531
}
25302532
};
25312533
bool match = false;
2532-
llvm::Value* source;
2534+
llvm::Value* source = nullptr;
25332535
if(isSat(&I, source))
25342536
{
25352537
SatPattern *satPattern = new (m_allocator) SatPattern();

IGC/Compiler/CISACodeGen/VectorPreProcess.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -583,7 +583,7 @@ bool VectorPreProcess::splitStore(AbstractStoreInst& ASI, V2SMap& vecToSubVec)
583583
if (svals.size() == 0)
584584
{
585585
// Need to create splitted values.
586-
Instruction *insertBeforeInst;
586+
Instruction *insertBeforeInst = nullptr;
587587
Value* scalars[VP_MAX_VECTOR_SIZE];
588588
getOrGenScalarValues(*SI->getParent()->getParent(),
589589
StoredVal, scalars, insertBeforeInst);

IGC/Compiler/CustomUnsafeOptPass.cpp

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1344,11 +1344,11 @@ bool CustomUnsafeOptPass::visitExchangeCB(llvm::BinaryOperator &I)
13441344
return false;
13451345
}
13461346

1347-
unsigned bufId;
1347+
unsigned bufId = 0;
13481348
unsigned cbIndex0 = 0;
13491349
unsigned cbIndex1 = 0;
13501350
unsigned hasCB = 0;
1351-
bool directBuf;
1351+
bool directBuf = false;
13521352

13531353
for (int i = 0; i < 2; i++)
13541354
{
@@ -2680,7 +2680,12 @@ bool EarlyOutPatterns::DotProductMatch(const Instruction *I)
26802680

26812681
using namespace PatternMatch;
26822682

2683-
Value *X1, *Y1, *Z1, *X2, *Y2, *Z2;
2683+
Value *X1 = nullptr;
2684+
Value *Y1 = nullptr;
2685+
Value *Z1 = nullptr;
2686+
Value *X2 = nullptr;
2687+
Value *Y2 = nullptr;
2688+
Value *Z2 = nullptr;
26842689

26852690
// dp3
26862691

IGC/Compiler/PromoteResourceToDirectAS.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ void PromoteResourceToDirectAS::PromoteSamplerTextureToDirectAS(GenIntrinsicInst
180180
// Only try to promote bindless pointers ( as(1) or as(2) ), or indirect buffer access
181181
return;
182182
}
183-
unsigned bufID;
183+
unsigned bufID = 0;
184184
BufferType bufTy;
185185
BufferAccessType accTy;
186186
bool canPromote = false;

0 commit comments

Comments
 (0)