[llvm] 5dc15dd - [AMDGPU] Default-initialize uninitialized class member variables (#108428)
via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 24 03:48:25 PDT 2024
Author: Georgi Mirazchiyski
Date: 2024-09-24T14:48:21+04:00
New Revision: 5dc15ddf575978e0115b1a6edacb59f056792a80
URL: https://github.com/llvm/llvm-project/commit/5dc15ddf575978e0115b1a6edacb59f056792a80
DIFF: https://github.com/llvm/llvm-project/commit/5dc15ddf575978e0115b1a6edacb59f056792a80.diff
LOG: [AMDGPU] Default-initialize uninitialized class member variables (#108428)
Added:
Modified:
llvm/lib/Target/AMDGPU/SIFixSGPRCopies.cpp
llvm/lib/Target/AMDGPU/SIMachineScheduler.h
Removed:
################################################################################
diff --git a/llvm/lib/Target/AMDGPU/SIFixSGPRCopies.cpp b/llvm/lib/Target/AMDGPU/SIFixSGPRCopies.cpp
index 434336ef137ff5..46f5097c679fb3 100644
--- a/llvm/lib/Target/AMDGPU/SIFixSGPRCopies.cpp
+++ b/llvm/lib/Target/AMDGPU/SIFixSGPRCopies.cpp
@@ -92,12 +92,12 @@ class V2SCopyInfo {
SetVector<MachineInstr *> SChain;
// Number of SGPR to VGPR copies that are used to put the SALU computation
// results back to VALU.
- unsigned NumSVCopies;
+ unsigned NumSVCopies = 0;
- unsigned Score;
+ unsigned Score = 0;
// Actual count of v_readfirstlane_b32
// which need to be inserted to keep SChain SALU
- unsigned NumReadfirstlanes;
+ unsigned NumReadfirstlanes = 0;
// Current score state. To speedup selection V2SCopyInfos for processing
bool NeedToBeConvertedToVALU = false;
// Unique ID. Used as a key for mapping to keep permanent order.
@@ -109,7 +109,7 @@ class V2SCopyInfo {
SetVector<unsigned> Siblings;
V2SCopyInfo() : Copy(nullptr), ID(0){};
V2SCopyInfo(unsigned Id, MachineInstr *C, unsigned Width)
- : Copy(C), NumSVCopies(0), NumReadfirstlanes(Width / 32), ID(Id){};
+ : Copy(C), NumReadfirstlanes(Width / 32), ID(Id){};
#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
void dump() {
dbgs() << ID << " : " << *Copy << "\n\tS:" << SChain.size()
diff --git a/llvm/lib/Target/AMDGPU/SIMachineScheduler.h b/llvm/lib/Target/AMDGPU/SIMachineScheduler.h
index ac34a748edbc1e..f8f4b5aae338eb 100644
--- a/llvm/lib/Target/AMDGPU/SIMachineScheduler.h
+++ b/llvm/lib/Target/AMDGPU/SIMachineScheduler.h
@@ -120,8 +120,8 @@ class SIScheduleBlock {
ArrayRef<std::pair<SIScheduleBlock*, SIScheduleBlockLinkKind>>
getSuccs() const { return Succs; }
- unsigned Height; // Maximum topdown path length to block without outputs
- unsigned Depth; // Maximum bottomup path length to block without inputs
+ unsigned Height = 0; // Maximum topdown path length to block without outputs
+ unsigned Depth = 0; // Maximum bottomup path length to block without inputs
unsigned getNumHighLatencySuccessors() const {
return NumHighLatencySuccessors;
More information about the llvm-commits
mailing list