Skip to content

Commit f3c4356

Browse files
smilczekigcbot
authored andcommitted
Minor fixes and refactors
This commit aims to address some potentially problematic places in the codebase.
1 parent 448c9ec commit f3c4356

File tree

10 files changed

+35
-12
lines changed

10 files changed

+35
-12
lines changed

visa/CFGStructurizer.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ typedef std::map<ANode *, ANode *> ANodeMap;
7373
// ANode base, abstract class
7474
class ANode {
7575
public:
76-
uint32_t anodeId;
76+
uint32_t anodeId = 0;
7777
ANodeType type;
7878
ANList preds;
7979
ANList succs;
@@ -140,8 +140,8 @@ class ANode {
140140

141141
private:
142142
// copy-ctor and assignment operator are not allowed
143-
ANode(const ANode &);
144-
ANode &operator=(const ANode &);
143+
ANode(const ANode &) = delete;
144+
ANode &operator=(const ANode &) = delete;
145145
};
146146

147147
// ANodeBB : ANode for a single BB
@@ -160,10 +160,10 @@ class ANodeBB : public ANode {
160160
// endif (join)
161161
// label0:
162162
//
163-
bool isJmpiTarget;
163+
bool isJmpiTarget = false;
164164

165165
explicit ANodeBB()
166-
: ANode(AN_BB), bb(nullptr), type(ANODEBB_NORMAL), isJmpiTarget(false) {}
166+
: ANode(AN_BB), bb(nullptr), type(ANODEBB_NORMAL) {}
167167
explicit ANodeBB(G4_BB *b) : ANode(AN_BB), bb(b), type(ANODEBB_NORMAL) {}
168168
virtual ~ANodeBB() {}
169169

visa/Common_BinaryEncoding.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ class BinInst {
128128
uint32_t instNumber; // Global instruction number
129129
bool compacted = false;
130130

131-
uint64_t genOffset;
131+
uint64_t genOffset = 0;
132132

133133
BinInst() {
134134
DWords[0] = 0;

visa/DebugInfo.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ class KernelDebugInfo {
366366
};
367367

368368
class SaveRestoreInfo {
369-
G4_INST* i = nullptr;
369+
G4_INST *i = nullptr;
370370

371371
public:
372372
// Map src GRF->GRF/Memory

visa/G4_Kernel.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -580,6 +580,9 @@ class G4_Kernel {
580580
uint32_t funcId, unsigned char major, unsigned char minor);
581581
~G4_Kernel();
582582

583+
G4_Kernel(const G4_Kernel &) = delete;
584+
G4_Kernel& operator=(const G4_Kernel &) = delete;
585+
583586
TARGET_PLATFORM getPlatform() const { return platformInfo.platform; }
584587
PlatformGen getPlatformGeneration() const { return platformInfo.family; }
585588
const char *getGenxPlatformString() const {

visa/GraphColor.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ class LiveRange final {
161161
unsigned numRegNeeded;
162162
unsigned degree = 0;
163163
unsigned refCount = 0;
164-
unsigned parentLRID;
164+
unsigned parentLRID = 0;
165165
AssignedReg reg;
166166
float spillCost = 0.0f;
167167
BankConflict bc = BANK_CONFLICT_NONE;

visa/Passes/StaticProfiling.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class StaticCycleProfiling {
4545
G4_Kernel &kernel;
4646
std::vector<InstCycle> tokenInsts;
4747
std::vector<DistPipeInsts> distInsts;
48-
LatencyTable *LT;
48+
LatencyTable *LT = nullptr;
4949

5050
unsigned BBStaticCycleProfiling(G4_BB *bb);
5151

visa/iga/IGALibrary/Backend/Messages/MessageDecoder.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ struct MessageDecoder {
252252
}
253253

254254
void
255-
setScatterGatherOp(const std::string& msgSym, const std::string& msgDesc, SendOp op,
255+
setScatterGatherOp(const std::string &msgSym, const std::string &msgDesc, SendOp op,
256256
AddrType addrType, SendDesc surfaceId, int addrSize,
257257
int bitsPerElem, int elemsPerAddr, int simd,
258258
MessageInfo::Attr extraAttrs = MessageInfo::Attr::NONE) {

visa/iga/IGALibrary/Backend/Messages/MessageDecoderHDC.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ struct MessageDecoderHDC : MessageDecoderLegacy {
324324
//
325325

326326
// allows different data sizes in mem and reg
327-
void setHdcMessageX(const std::string& msgSym, const std::string& msgDesc, SendOp op,
327+
void setHdcMessageX(const std::string &msgSym, const std::string &msgDesc, SendOp op,
328328
int addrSizeBits, int bitsPerElemReg, int bitsPerElemMem,
329329
int elemsPerAddr, int execSize,
330330
MessageInfo::Attr extraAttrs) {
@@ -429,7 +429,7 @@ struct MessageDecoderHDC : MessageDecoderLegacy {
429429
elemsPerAddr, execSize, extraAttrs);
430430
}
431431

432-
void setHdcOwBlock(const std::string& msgSym, const std::string& msgDesc, SendOp op,
432+
void setHdcOwBlock(const std::string &msgSym, const std::string &msgDesc, SendOp op,
433433
int addrSize, MessageInfo::Attr extraAttrs) {
434434
enum MDC_A64_DB_OW {
435435
OW1L = 0x0,

visa/iga/IGALibrary/IR/BitSet.hpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,23 @@ template <typename I = uint32_t> class BitSet {
7171
return *this;
7272
}
7373

74+
BitSet<I> &operator=(BitSet<I> &&rhs) {
75+
if (this == &rhs) {
76+
return *this;
77+
}
78+
if (words) {
79+
delete[] words;
80+
}
81+
82+
N = rhs.N;
83+
wordsSize = rhs.wordsSize;
84+
words = rhs.words;
85+
86+
rhs.words = nullptr;
87+
88+
return *this;
89+
}
90+
7491
~BitSet() {
7592
if (words) {
7693
delete[] words;

visa/iga/IGALibrary/IR/RegDeps.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,9 @@ class DepSetBuilder {
271271
delete ds;
272272
}
273273

274+
DepSetBuilder(const DepSetBuilder &) = delete;
275+
DepSetBuilder &operator=(const DepSetBuilder &) = delete;
276+
274277
public:
275278
// DepSet creater
276279
/// createSrcDepSet - create DepSet for src operands of instruction i

0 commit comments

Comments
 (0)