diff --git a/visa/CFGStructurizer.cpp b/visa/CFGStructurizer.cpp index 1f55906aec13..77a48645aa7d 100644 --- a/visa/CFGStructurizer.cpp +++ b/visa/CFGStructurizer.cpp @@ -73,7 +73,7 @@ typedef std::map ANodeMap; // ANode base, abstract class class ANode { public: - uint32_t anodeId; + uint32_t anodeId = 0; ANodeType type; ANList preds; ANList succs; @@ -140,8 +140,8 @@ class ANode { private: // copy-ctor and assignment operator are not allowed - ANode(const ANode &); - ANode &operator=(const ANode &); + ANode(const ANode &) = delete; + ANode &operator=(const ANode &) = delete; }; // ANodeBB : ANode for a single BB @@ -160,10 +160,10 @@ class ANodeBB : public ANode { // endif (join) // label0: // - bool isJmpiTarget; + bool isJmpiTarget = false; explicit ANodeBB() - : ANode(AN_BB), bb(nullptr), type(ANODEBB_NORMAL), isJmpiTarget(false) {} + : ANode(AN_BB), bb(nullptr), type(ANODEBB_NORMAL) {} explicit ANodeBB(G4_BB *b) : ANode(AN_BB), bb(b), type(ANODEBB_NORMAL) {} virtual ~ANodeBB() {} diff --git a/visa/Common_BinaryEncoding.h b/visa/Common_BinaryEncoding.h index c6f550390ad3..38498ebf21ec 100644 --- a/visa/Common_BinaryEncoding.h +++ b/visa/Common_BinaryEncoding.h @@ -128,7 +128,7 @@ class BinInst { uint32_t instNumber; // Global instruction number bool compacted = false; - uint64_t genOffset; + uint64_t genOffset = 0; BinInst() { DWords[0] = 0; diff --git a/visa/DebugInfo.h b/visa/DebugInfo.h index 4d03b14a6def..906540e07d25 100644 --- a/visa/DebugInfo.h +++ b/visa/DebugInfo.h @@ -366,7 +366,7 @@ class KernelDebugInfo { }; class SaveRestoreInfo { - G4_INST* i = nullptr; + G4_INST *i = nullptr; public: // Map src GRF->GRF/Memory diff --git a/visa/G4_Kernel.hpp b/visa/G4_Kernel.hpp index be1aebbcccda..00ba61eeedb8 100644 --- a/visa/G4_Kernel.hpp +++ b/visa/G4_Kernel.hpp @@ -580,6 +580,9 @@ class G4_Kernel { uint32_t funcId, unsigned char major, unsigned char minor); ~G4_Kernel(); + G4_Kernel(const G4_Kernel &) = delete; + G4_Kernel& operator=(const G4_Kernel &) = delete; + TARGET_PLATFORM getPlatform() const { return platformInfo.platform; } PlatformGen getPlatformGeneration() const { return platformInfo.family; } const char *getGenxPlatformString() const { diff --git a/visa/GraphColor.h b/visa/GraphColor.h index 8a71f49e491f..318fabd3b75e 100644 --- a/visa/GraphColor.h +++ b/visa/GraphColor.h @@ -161,7 +161,7 @@ class LiveRange final { unsigned numRegNeeded; unsigned degree = 0; unsigned refCount = 0; - unsigned parentLRID; + unsigned parentLRID = 0; AssignedReg reg; float spillCost = 0.0f; BankConflict bc = BANK_CONFLICT_NONE; diff --git a/visa/Passes/StaticProfiling.hpp b/visa/Passes/StaticProfiling.hpp index 501a88f35af7..1b0999215d68 100644 --- a/visa/Passes/StaticProfiling.hpp +++ b/visa/Passes/StaticProfiling.hpp @@ -45,7 +45,7 @@ class StaticCycleProfiling { G4_Kernel &kernel; std::vector tokenInsts; std::vector distInsts; - LatencyTable *LT; + LatencyTable *LT = nullptr; unsigned BBStaticCycleProfiling(G4_BB *bb); diff --git a/visa/iga/IGALibrary/Backend/Messages/MessageDecoder.hpp b/visa/iga/IGALibrary/Backend/Messages/MessageDecoder.hpp index bf6d0e704297..0d48eac7c8cb 100644 --- a/visa/iga/IGALibrary/Backend/Messages/MessageDecoder.hpp +++ b/visa/iga/IGALibrary/Backend/Messages/MessageDecoder.hpp @@ -252,7 +252,7 @@ struct MessageDecoder { } void - setScatterGatherOp(const std::string& msgSym, const std::string& msgDesc, SendOp op, + setScatterGatherOp(const std::string &msgSym, const std::string &msgDesc, SendOp op, AddrType addrType, SendDesc surfaceId, int addrSize, int bitsPerElem, int elemsPerAddr, int simd, MessageInfo::Attr extraAttrs = MessageInfo::Attr::NONE) { diff --git a/visa/iga/IGALibrary/Backend/Messages/MessageDecoderHDC.cpp b/visa/iga/IGALibrary/Backend/Messages/MessageDecoderHDC.cpp index 620672f0982b..8685f5a6e6b4 100644 --- a/visa/iga/IGALibrary/Backend/Messages/MessageDecoderHDC.cpp +++ b/visa/iga/IGALibrary/Backend/Messages/MessageDecoderHDC.cpp @@ -324,7 +324,7 @@ struct MessageDecoderHDC : MessageDecoderLegacy { // // allows different data sizes in mem and reg - void setHdcMessageX(const std::string& msgSym, const std::string& msgDesc, SendOp op, + void setHdcMessageX(const std::string &msgSym, const std::string &msgDesc, SendOp op, int addrSizeBits, int bitsPerElemReg, int bitsPerElemMem, int elemsPerAddr, int execSize, MessageInfo::Attr extraAttrs) { @@ -429,7 +429,7 @@ struct MessageDecoderHDC : MessageDecoderLegacy { elemsPerAddr, execSize, extraAttrs); } - void setHdcOwBlock(const std::string& msgSym, const std::string& msgDesc, SendOp op, + void setHdcOwBlock(const std::string &msgSym, const std::string &msgDesc, SendOp op, int addrSize, MessageInfo::Attr extraAttrs) { enum MDC_A64_DB_OW { OW1L = 0x0, diff --git a/visa/iga/IGALibrary/IR/BitSet.hpp b/visa/iga/IGALibrary/IR/BitSet.hpp index 1e8690e81aad..978975e19713 100644 --- a/visa/iga/IGALibrary/IR/BitSet.hpp +++ b/visa/iga/IGALibrary/IR/BitSet.hpp @@ -71,6 +71,23 @@ template class BitSet { return *this; } + BitSet &operator=(BitSet &&rhs) { + if (this == &rhs) { + return *this; + } + if (words) { + delete[] words; + } + + N = rhs.N; + wordsSize = rhs.wordsSize; + words = rhs.words; + + rhs.words = nullptr; + + return *this; + } + ~BitSet() { if (words) { delete[] words; diff --git a/visa/iga/IGALibrary/IR/RegDeps.hpp b/visa/iga/IGALibrary/IR/RegDeps.hpp index 896a6f85c981..29ffa471e4a6 100644 --- a/visa/iga/IGALibrary/IR/RegDeps.hpp +++ b/visa/iga/IGALibrary/IR/RegDeps.hpp @@ -271,6 +271,9 @@ class DepSetBuilder { delete ds; } + DepSetBuilder(const DepSetBuilder &) = delete; + DepSetBuilder &operator=(const DepSetBuilder &) = delete; + public: // DepSet creater /// createSrcDepSet - create DepSet for src operands of instruction i