Skip to content

Commit 8d4b8dc

Browse files
jhananitsys_zuul
authored andcommitted
Returns weight information for each interesting Constant along with the instruction stats.
Change-Id: Id855800b1483e84fc75a03bc47d049d0c934b6e7
1 parent fbd67a0 commit 8d4b8dc

File tree

7 files changed

+350
-97
lines changed

7 files changed

+350
-97
lines changed

IGC/Compiler/CISACodeGen/AdvCodeMotion.cpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -273,16 +273,6 @@ static bool hasMemoryWrite(BasicBlock* BB) {
273273
return false;
274274
}
275275

276-
static bool isDummyBasicBlock(BasicBlock* BB) {
277-
if (BB->size() != 1)
278-
return false;
279-
if ((++pred_begin(BB)) != pred_end(BB))
280-
return false;
281-
if ((++succ_begin(BB)) != succ_end(BB))
282-
return false;
283-
return true;
284-
}
285-
286276
static BasicBlock* getJointBasicBlock(PostDominatorTree* PDT, BasicBlock* BB,
287277
BasicBlock* IfBB) {
288278
if (isDummyBasicBlock(BB))

IGC/Compiler/CISACodeGen/helper.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,17 @@ namespace IGC
105105
return temp.u32Val;
106106
}
107107

108+
bool isDummyBasicBlock(llvm::BasicBlock* BB)
109+
{
110+
if (BB->size() != 1)
111+
return false;
112+
if ((++pred_begin(BB)) != pred_end(BB))
113+
return false;
114+
if ((++succ_begin(BB)) != succ_end(BB))
115+
return false;
116+
return true;
117+
}
118+
108119
unsigned SetBufferAsBindless(unsigned addressSpaceOfPtr, BufferType bufferType)
109120
{
110121
GFXResourceAddrSpace temp = {};

IGC/Compiler/CISACodeGen/helper.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,8 @@ namespace IGC
184184
BufferType DecodeAS4GFXResource(unsigned addrSpace, bool& directIdx, unsigned& bufId);
185185
int getConstantBufferLoadOffset(llvm::LoadInst* ld);
186186

187+
bool isDummyBasicBlock(llvm::BasicBlock* BB);
188+
187189
bool IsDirectIdx(unsigned addrSpace);
188190
bool isNaNCheck(llvm::FCmpInst& FC);
189191

IGC/Compiler/CodeGenPublic.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,11 @@ namespace IGC
255255
ConstantAddress ca;
256256
bool anyValue;
257257
uint32_t value;
258+
uint32_t instCount = 0;
259+
uint32_t branchCount = 0;
260+
uint32_t loopCount = 0;
261+
uint32_t samplerCount = 0;
262+
uint32_t weight = 0;
258263
};
259264

260265
struct SKernelProgram

0 commit comments

Comments
 (0)