Skip to content

Commit 5dc15dd

Browse files
authored
[AMDGPU] Default-initialize uninitialized class member variables (#108428)
1 parent 6cfe6a6 commit 5dc15dd

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

llvm/lib/Target/AMDGPU/SIFixSGPRCopies.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,12 +92,12 @@ class V2SCopyInfo {
9292
SetVector<MachineInstr *> SChain;
9393
// Number of SGPR to VGPR copies that are used to put the SALU computation
9494
// results back to VALU.
95-
unsigned NumSVCopies;
95+
unsigned NumSVCopies = 0;
9696

97-
unsigned Score;
97+
unsigned Score = 0;
9898
// Actual count of v_readfirstlane_b32
9999
// which need to be inserted to keep SChain SALU
100-
unsigned NumReadfirstlanes;
100+
unsigned NumReadfirstlanes = 0;
101101
// Current score state. To speedup selection V2SCopyInfos for processing
102102
bool NeedToBeConvertedToVALU = false;
103103
// Unique ID. Used as a key for mapping to keep permanent order.
@@ -109,7 +109,7 @@ class V2SCopyInfo {
109109
SetVector<unsigned> Siblings;
110110
V2SCopyInfo() : Copy(nullptr), ID(0){};
111111
V2SCopyInfo(unsigned Id, MachineInstr *C, unsigned Width)
112-
: Copy(C), NumSVCopies(0), NumReadfirstlanes(Width / 32), ID(Id){};
112+
: Copy(C), NumReadfirstlanes(Width / 32), ID(Id){};
113113
#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
114114
void dump() {
115115
dbgs() << ID << " : " << *Copy << "\n\tS:" << SChain.size()

llvm/lib/Target/AMDGPU/SIMachineScheduler.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,8 @@ class SIScheduleBlock {
120120
ArrayRef<std::pair<SIScheduleBlock*, SIScheduleBlockLinkKind>>
121121
getSuccs() const { return Succs; }
122122

123-
unsigned Height; // Maximum topdown path length to block without outputs
124-
unsigned Depth; // Maximum bottomup path length to block without inputs
123+
unsigned Height = 0; // Maximum topdown path length to block without outputs
124+
unsigned Depth = 0; // Maximum bottomup path length to block without inputs
125125

126126
unsigned getNumHighLatencySuccessors() const {
127127
return NumHighLatencySuccessors;

0 commit comments

Comments
 (0)