From 97a00b7b20832cdf9d426f1911c8ac5bd67f040d Mon Sep 17 00:00:00 2001 From: Andrea Di Biagio Date: Wed, 24 Mar 2021 11:20:15 +0000 Subject: [PATCH] [MCA] Fix for uninitialised member in constructor. NFC --- llvm/include/llvm/MCA/HardwareUnits/RegisterFile.h | 4 +++- llvm/lib/MCA/HardwareUnits/RegisterFile.cpp | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/llvm/include/llvm/MCA/HardwareUnits/RegisterFile.h b/llvm/include/llvm/MCA/HardwareUnits/RegisterFile.h index 735ed7470280..510cff4b5934 100644 --- a/llvm/include/llvm/MCA/HardwareUnits/RegisterFile.h +++ b/llvm/include/llvm/MCA/HardwareUnits/RegisterFile.h @@ -45,7 +45,9 @@ class WriteRef { static const unsigned INVALID_IID; public: - WriteRef() : IID(INVALID_IID), WriteBackCycle(), WriteResID(), Write() {} + WriteRef() + : IID(INVALID_IID), WriteBackCycle(), WriteResID(), RegisterID(), + Write() {} WriteRef(unsigned SourceIndex, WriteState *WS); unsigned getSourceIndex() const { return IID; } diff --git a/llvm/lib/MCA/HardwareUnits/RegisterFile.cpp b/llvm/lib/MCA/HardwareUnits/RegisterFile.cpp index eface5b37118..a48915dbed73 100644 --- a/llvm/lib/MCA/HardwareUnits/RegisterFile.cpp +++ b/llvm/lib/MCA/HardwareUnits/RegisterFile.cpp @@ -25,7 +25,8 @@ namespace mca { const unsigned WriteRef::INVALID_IID = std::numeric_limits::max(); WriteRef::WriteRef(unsigned SourceIndex, WriteState *WS) - : IID(SourceIndex), WriteBackCycle(), WriteResID(), Write(WS) {} + : IID(SourceIndex), WriteBackCycle(), WriteResID(), RegisterID(), + Write(WS) {} void WriteRef::commit() { assert(Write && Write->isExecuted() && "Cannot commit before write back!");