[llvm] 6d4d019 - [MCA] Modernize MemoryGroup (NFC)

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Sat Jun 3 11:01:29 PDT 2023


Author: Kazu Hirata
Date: 2023-06-03T11:01:15-07:00
New Revision: 6d4d019654676c822aaedf2c3b861af91721bd28

URL: https://github.com/llvm/llvm-project/commit/6d4d019654676c822aaedf2c3b861af91721bd28
DIFF: https://github.com/llvm/llvm-project/commit/6d4d019654676c822aaedf2c3b861af91721bd28.diff

LOG: [MCA] Modernize MemoryGroup (NFC)

Added: 
    

Modified: 
    llvm/include/llvm/MCA/HardwareUnits/LSUnit.h

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/MCA/HardwareUnits/LSUnit.h b/llvm/include/llvm/MCA/HardwareUnits/LSUnit.h
index 9882c4851d6e3..81a5453bac26c 100644
--- a/llvm/include/llvm/MCA/HardwareUnits/LSUnit.h
+++ b/llvm/include/llvm/MCA/HardwareUnits/LSUnit.h
@@ -33,13 +33,13 @@ namespace mca {
 /// Instruction::LSUTokenID of each dispatched instructions. That token is used
 /// internally by the LSUnit to track memory dependencies.
 class MemoryGroup {
-  unsigned NumPredecessors;
-  unsigned NumExecutingPredecessors;
-  unsigned NumExecutedPredecessors;
+  unsigned NumPredecessors = 0;
+  unsigned NumExecutingPredecessors = 0;
+  unsigned NumExecutedPredecessors = 0;
 
-  unsigned NumInstructions;
-  unsigned NumExecuting;
-  unsigned NumExecuted;
+  unsigned NumInstructions = 0;
+  unsigned NumExecuting = 0;
+  unsigned NumExecuted = 0;
   // Successors that are in a order dependency with this group.
   SmallVector<MemoryGroup *, 4> OrderSucc;
   // Successors that are in a data dependency with this group.
@@ -52,10 +52,7 @@ class MemoryGroup {
   MemoryGroup &operator=(const MemoryGroup &) = delete;
 
 public:
-  MemoryGroup()
-      : NumPredecessors(0), NumExecutingPredecessors(0),
-        NumExecutedPredecessors(0), NumInstructions(0), NumExecuting(0),
-        NumExecuted(0), CriticalPredecessor() {}
+  MemoryGroup() = default;
   MemoryGroup(MemoryGroup &&) = default;
 
   size_t getNumSuccessors() const {


        


More information about the llvm-commits mailing list