Skip to content

Commit 312ccf2

Browse files
mmereckigfxbot
authored andcommitted
Internal Feature
Change-Id: I840ea18703660c3d77b08cecb49db6e0f5c23eaa
1 parent f7b9732 commit 312ccf2

File tree

5 files changed

+43
-35
lines changed

5 files changed

+43
-35
lines changed

IGC/Compiler/CISACodeGen/CISABuilder.cpp

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -820,7 +820,7 @@ VISA_PredOpnd* CEncoder::GetFlagOperand(const SFlag& flag)
820820
VISA_PREDICATE_STATE predState = (flag.invertFlag)
821821
? PredState_INVERSE : PredState_NO_INVERSE;
822822
VISA_PREDICATE_CONTROL predCtrl = PRED_CTRL_NON;
823-
823+
824824
switch (flag.mode)
825825
{
826826
case EPRED_ALL: predCtrl = PRED_CTRL_ALL; break;
@@ -889,7 +889,7 @@ Common_VISA_EMask_Ctrl CEncoder::GetAluEMask(CVariable* dst)
889889
noMask = true;
890890
}
891891
}
892-
}
892+
}
893893

894894
return ConvertMaskToVisaType(mask, noMask);
895895
}
@@ -1515,7 +1515,7 @@ void CEncoder::LogicOp(
15151515
if(src1 != NULL)
15161516
src1Dcl = src1->visaPredVariable;
15171517

1518-
// Try to use NOT instruction for predicate, we won't have phi on
1518+
// Try to use NOT instruction for predicate, we won't have phi on
15191519
// predicate since Legalization pass convert i1 phi to i32.
15201520
if (opcode == ISA_NOT)
15211521
SetNoMask();
@@ -2424,7 +2424,7 @@ void CEncoder::Gather4Inst(
24242424
if (!isIdxLT16)
24252425
{
24262426
uint16_t aoffimmiVal = (uint16_t)offset->GetImmediateValue() | BIT(15);
2427-
V(vKernel->CreateVISAImmediate(aoffimmi, &aoffimmiVal, ISA_TYPE_UW));
2427+
V(vKernel->CreateVISAImmediate(aoffimmi, &aoffimmiVal, ISA_TYPE_UW));
24282428
}
24292429

24302430
V(vKernel->AppendVISA3dGather4(
@@ -2498,7 +2498,7 @@ void CEncoder::Fence(bool CommitEnable,
24982498
( L3_Flush_Constant_Data << 3 ) |
24992499
( L3_Flush_RW_Data << 4 ) |
25002500
( (!Global_Mem_Fence) << 5 ) | // bit 5: 1 -- local, 0 -- global
2501-
( L1_Flush_Constant_Data << 6 ) |
2501+
( L1_Flush_Constant_Data << 6 ) |
25022502
( SWFence << 7 ) |
25032503
( CommitEnable << 0 );
25042504

@@ -3472,18 +3472,18 @@ void CEncoder::InitEncoder( bool canAbortOnSpill )
34723472
SetVISAWaTable(m_program->m_Platform->getWATable());
34733473

34743474
bool enableVISADump = IGC_IS_FLAG_ENABLED(EnableVISASlowpath) || IGC_IS_FLAG_ENABLED(ShaderDumpEnable);
3475-
V(CreateVISABuilder(vbuilder, vISA_3D, enableVISADump ? CM_CISA_BUILDER_BOTH : CM_CISA_BUILDER_GEN,
3475+
V(CreateVISABuilder(vbuilder, vISA_3D, enableVISADump ? CM_CISA_BUILDER_BOTH : CM_CISA_BUILDER_GEN,
34763476
VISAPlatform, params.size(), params.data(), &m_WaTable));
34773477

3478-
// Set up options. This must be done before creating any variable/instructions
3478+
// Set up options. This must be done before creating any variable/instructions
34793479
// since some of the options affect IR building.
34803480

34813481
if (IGC_IS_FLAG_ENABLED(ForceNoFP64bRegioning))
34823482
{
34833483
vbuilder->SetOption(vISA_forceNoFP64bRegioning, true);
34843484
}
34853485

3486-
if (context->type == ShaderType::OPENCL_SHADER && context->m_floatDenormMode32 == FLOAT_DENORM_RETAIN &&
3486+
if (context->type == ShaderType::OPENCL_SHADER && context->m_floatDenormMode32 == FLOAT_DENORM_RETAIN &&
34873487
context->m_floatDenormMode64 == FLOAT_DENORM_RETAIN)
34883488
{
34893489
vbuilder->SetOption(vISA_hasRNEandDenorm, true);
@@ -3736,7 +3736,7 @@ void CEncoder::InitEncoder( bool canAbortOnSpill )
37363736
{
37373737
/* Some tools only use 32bits hash, to maintain compatibility
37383738
across lot of unknown tool chains doing Compare for only LowerPart
3739-
*/
3739+
*/
37403740
if (IGC_GET_FLAG_VALUE(ShaderDebugHashCode) == (DWORD)context->hash.getAsmHash())
37413741
{
37423742
vbuilder->SetOption(vISA_setStartBreakPoint, true);
@@ -4216,9 +4216,9 @@ void CEncoder::Compile()
42164216
{
42174217
context->m_retryManager.SetSpillSize(jitInfo->numGRFSpillFill);
42184218
m_program->m_spillSize = jitInfo->numGRFSpillFill;
4219-
m_program->m_spillCost =
4219+
m_program->m_spillCost =
42204220
float(jitInfo->numGRFSpillFill) / jitInfo->numAsmCount;
4221-
4221+
42224222
context->m_retryManager.numInstructions = jitInfo->numAsmCount;
42234223
}
42244224
COMPILER_TIME_END(m_program->GetContext(), TIME_CG_vISACompile);
@@ -4269,9 +4269,7 @@ void CEncoder::Compile()
42694269
MEM_SNAPSHOT( IGC::SMS_AFTER_vISACompile_SIMD32 );
42704270
}
42714271

4272-
if ((context->type == ShaderType::PIXEL_SHADER ||
4273-
context->type == ShaderType::COMPUTE_SHADER )&&
4274-
m_program->m_dispatchSize == SIMDMode::SIMD16)
4272+
if (m_program->m_dispatchSize == SIMDMode::SIMD16)
42754273
{
42764274
uint sendStallCycle = 0;
42774275
uint staticCycle = 0;

IGC/Compiler/CodeGenContext.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,8 @@ bool RetryManager::PickupKernels(CodeGenContext* cgCtx)
176176
}
177177

178178
unsigned RetryManager::getStateCnt()
179-
{
180-
return sizeof(RetryTable) / sizeof(RetryState);
179+
{
180+
return sizeof(RetryTable) / sizeof(RetryState);
181181
};
182182

183183
CShader* RetryManager::PickCSEntryForcedFromDriver(SIMDMode& simdMode, unsigned char forcedSIMDModeFromDriver)
@@ -284,7 +284,7 @@ CShader* RetryManager::PickCSEntryEarly(SIMDMode& simdMode,
284284
simdMode = SIMDMode::SIMD16;
285285
return m_simdEntries[1];
286286
}
287-
assert((m_simdEntries[0] == NULL) || simd8NoSpill == true); // If SIMD16 doesn't spill, SIMD8 shouldn't, if it exists
287+
assert((m_simdEntries[0] == NULL) || simd8NoSpill == true); // If SIMD16 doesn't spill, SIMD8 shouldn't, if it exists
288288
}
289289
}
290290

@@ -412,9 +412,9 @@ LLVMContextWrapper::LLVMContextWrapper(bool createResourceDimTypes)
412412
}
413413
}
414414

415-
void LLVMContextWrapper::AddRef()
415+
void LLVMContextWrapper::AddRef()
416416
{
417-
refCount++;
417+
refCount++;
418418
}
419419

420420
void LLVMContextWrapper::Release()
@@ -703,4 +703,6 @@ bool CodeGenContext::isPOSH() const
703703
"IGC::PositionOnlyVertexShader") != nullptr;
704704
}
705705

706+
707+
706708
}

IGC/Compiler/CodeGenPublic.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ namespace IGC
226226
bool isPerSample;
227227
bool oMask;
228228
bool VectorMask;
229-
229+
230230
bool hasPrimID;
231231
bool isCoarsePS;
232232
bool hasCoarsePixelSize;
@@ -258,7 +258,7 @@ namespace IGC
258258
OctEltUnit VertexURBEntryReadLength;
259259
/// corresponds to 3DSTATE_VS Vertex URB Entry Read Offset
260260
OctEltUnit VertexURBEntryReadOffset;
261-
/// corresponds to 3DSTATE_VS VS Vertex URB Entry Output Length
261+
/// corresponds to 3DSTATE_VS VS Vertex URB Entry Output Length
262262
OctEltUnit VertexURBEntryOutputReadLength;
263263
/// corresponds to 3DSTATE_VS VS Vertex URB Entry Output Offset
264264
OctEltUnit VertexURBEntryOutputReadOffset;
@@ -500,7 +500,7 @@ namespace IGC
500500

501501
CBTILayout(
502502
const USC::SShaderStageBTLayout* pLayout,
503-
const std::vector<unsigned char>& colorBufferMappings) :
503+
const std::vector<unsigned char>& colorBufferMappings) :
504504
m_pLayout(pLayout),
505505
m_ColorBufferMappings(colorBufferMappings)
506506
{}
@@ -544,10 +544,10 @@ namespace IGC
544544
bool IsFirstTry();
545545
bool IsLastTry(CodeGenContext* cgCtx);
546546
unsigned GetRetryId() const;
547-
547+
548548
void Enable();
549549
void Disable();
550-
550+
551551
void SetSpillSize(unsigned int spillSize);
552552
unsigned int GetLastSpillSize();
553553
unsigned int numInstructions = 0;
@@ -577,7 +577,7 @@ namespace IGC
577577
// cache the compiled kernel during retry
578578
CShader* m_simdEntries[3];
579579

580-
CShader* PickCSEntryForcedFromDriver(SIMDMode& simdMode,
580+
CShader* PickCSEntryForcedFromDriver(SIMDMode& simdMode,
581581
unsigned char forcedSIMDModeFromDriver);
582582
CShader* PickCSEntryByRegKey(SIMDMode& simdMode);
583583
CShader* PickCSEntryEarly(SIMDMode& simdMode,
@@ -673,7 +673,7 @@ namespace IGC
673673
const CPlatform& _platform, ///< IGC HW platform description
674674
const CDriverInfo& driverInfo, ///< Queries to know runtime features support
675675
const bool createResourceDimTypes = true,
676-
LLVMContextWrapper* LLVMContext = nullptr)///< LLVM context to use, if null a new one will be created
676+
LLVMContextWrapper* LLVMContext = nullptr)///< LLVM context to use, if null a new one will be created
677677
: type(_type), platform(_platform), btiLayout(_bitLayout), m_DriverInfo(driverInfo), llvmCtxWrapper(LLVMContext)
678678
{
679679
if (llvmCtxWrapper == nullptr)
@@ -989,7 +989,7 @@ namespace IGC
989989
const COCLBTILayout& btiLayout,
990990
const CPlatform& platform,
991991
const TC::STB_TranslateInputArgs* pInputArgs,
992-
const CDriverInfo& driverInfo,
992+
const CDriverInfo& driverInfo,
993993
LLVMContextWrapper* llvmContext = nullptr,
994994
bool shouldUseNonCoherentStatelessBTI = false,
995995
const bool createResourceDimTypes = true)

IGC/common/MDFrameWork.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ namespace IGC
136136
std::vector<int> colorOutputMask;
137137
};
138138

139+
139140
struct SInputDesc
140141
{
141142
unsigned int index = 0;
@@ -194,7 +195,7 @@ namespace IGC
194195
int alignment;
195196
std::vector<unsigned char> Buffer;
196197
};
197-
198+
198199
struct ImmConstantInfo
199200
{
200201
std::vector<char> data;
@@ -244,7 +245,7 @@ namespace IGC
244245

245246
// When true compiler can assume that resources bound to two different
246247
// bindings do not alias.
247-
bool statefullResourcesNotAliased = false;
248+
bool statefullResourcesNotAliased = false;
248249

249250
unsigned int privateMemoryPerWI = 0;
250251
std::array<uint64_t, NUM_SHADER_RESOURCE_VIEW_SIZE> m_ShaderResourceViewMcsMask;

IGC/common/autogen.py

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232

3333
# usage: autogen.py <path_to_MDFrameWork.h> <path_to_MDNodeFuncs.gen>
3434
__MDFrameWorkFile__ = sys.argv[1]
35-
__genFile__ = sys.argv[2]
35+
__genFile__ = sys.argv[2]
3636

3737
__genDir__ = os.path.dirname(__genFile__)
3838
if not os.path.exists(__genDir__):
@@ -60,7 +60,7 @@
6060
line = next(file, None)
6161
insideIGCNameSpace = True
6262
if insideIGCNameSpace:
63-
line = line.split("//")[0]
63+
line = line.split("//")[0]
6464
if line.find("struct") != -1:
6565
words = line.split()
6666
structureNames.append(words[1])
@@ -79,6 +79,9 @@
7979
if line.find("};") != -1:
8080
insideIGCNameSpace = False
8181

82+
def skipLine(line):
83+
return False
84+
8285
def storeVars(line):
8386
vars = line.split()
8487
for i in range(1, len(vars)):
@@ -198,7 +201,7 @@ def genCode():
198201
foundStruct = False
199202
insideStruct = False
200203
output.write("}\n\n")
201-
204+
202205
for item in structureNames:
203206
foundStruct = False
204207
insideStruct = False
@@ -222,18 +225,20 @@ def genCode():
222225
inputFile.close()
223226
continue
224227
else:
225-
if line:
228+
if skipLine(line) == False:
226229
line = line.split("//")[0]
227230
while line.find("};") == -1:
228231
extractVars(line)
229232
line = next(file, None)
233+
while skipLine(line) == True:
234+
line = next(file, None)
230235
line = line.split("//")[0]
231236
printCalls(item)
232237
del structDataMembers[:]
233238
foundStruct = False
234239
insideStruct = False
235240
output.write("}\n\n")
236-
241+
237242
for item in enumNames:
238243
foundStruct = False
239244
insideStruct = False
@@ -294,11 +299,13 @@ def genCode():
294299
inputFile.close()
295300
continue
296301
else:
297-
if line:
302+
if skipLine(line) == False:
298303
line = line.split("//")[0]
299304
while line.find("};") == -1:
300305
extractVars(line)
301306
line = next(file, None)
307+
while skipLine(line) == True:
308+
line = next(file, None)
302309
line = line.split("//")[0]
303310
printReadCalls(item)
304311
del structDataMembers[:]

0 commit comments

Comments
 (0)