Skip to content

Commit 4e496d7

Browse files
committed
Change the method of commenting so compiler doesnt throw multi-line comment warning. The problem appears when the backslash is the last character of the line of single-line comments. This happens for example when multi-line macro is commented out with two slashes.
Change-Id: I8e52a1d8c9ce549060e916ad7880cd18df58689c
1 parent 3c95d69 commit 4e496d7

File tree

10 files changed

+185
-182
lines changed

10 files changed

+185
-182
lines changed

IGC/Compiler/CISACodeGen/AdvCodeMotion.cpp

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -411,17 +411,18 @@ bool AdvCodeMotion::hoistMost2(bool InvPred, BasicBlock* IfBB,
411411
return false;
412412
}
413413

414-
// IfBB IfBB
415-
// / \ TBB
416-
// | TBB / \
417-
// | / \ FBB2 TBB2
418-
// | FBB2 TBB2 => | ...
419-
// FBB | ... \ /
420-
// | \ / JBB2
421-
// | JBB2 JBB
422-
// \ /
423-
// JBB
424-
// Hoist TBB only and simplify the CFG.
414+
/* IfBB IfBB
415+
/ \ TBB
416+
| TBB / \
417+
| / \ FBB2 TBB2
418+
| FBB2 TBB2 => | ...
419+
FBB | ... \ /
420+
| \ / JBB2
421+
| JBB2 JBB
422+
\ /
423+
JBB
424+
Hoist TBB only and simplify the CFG.
425+
*/
425426

426427
// Merge TBB into IfBB.
427428
if (InvPred) {

IGC/Compiler/CISACodeGen/EstimateFunctionSize.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -74,15 +74,15 @@ bool EstimateFunctionSize::runOnModule(Module& Mod) {
7474
}
7575

7676
// Given a module, estimate the maximal function size with complete inlining.
77-
//
78-
// A ----> B ----> C ---> D ---> F
79-
// \ \ \
80-
// \ \ \---> E
81-
// \ \
82-
// \ \---> C ---> D --> F
83-
// \ \
84-
// \----> F \---> E
85-
//
77+
/*
78+
A ----> B ----> C ---> D ---> F
79+
\ \ \
80+
\ \ \---> E
81+
\ \
82+
\ \---> C ---> D --> F
83+
\ \
84+
\----> F \---> E
85+
*/
8686
// ExpandedSize(A) = size(A) + size(B) + 2 * size(C) + 2 * size(D)
8787
// + 2 * size(E) + 3 * size(F)
8888
//

IGC/Compiler/CustomUnsafeOptPass.cpp

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3749,19 +3749,20 @@ HoistFMulInLoopPass::MulNode* HoistFMulInLoopPass::visitFMul(
37493749
// So we can optimize %90/%91/%92, while %82 need to be leave unmodified.
37503750
//
37513751
// The expression tree we built for %85 is:
3752-
// %85
3753-
// / \
3754-
// %83 \
3755-
// / \ \
3756-
// %81 ---%inv
3757-
// And we will try to recursively propogate %81 to %83 & %85, and remove
3758-
// %83 from the tree:
3759-
// ==> %85 ==> %85->%81
3760-
// / \ [%inv, %inv]
3761-
// / \
3762-
// %83->%81 \
3763-
// [%inv] \
3764-
// %inv
3752+
/* %85
3753+
/ \
3754+
%83 \
3755+
/ \ \
3756+
%81 ---%inv
3757+
And we will try to recursively propogate %81 to %83 & %85, and remove
3758+
%83 from the tree:
3759+
==> %85 ==> %85->%81
3760+
/ \ [%inv, %inv]
3761+
/ \
3762+
%83->%81 \
3763+
[%inv] \
3764+
%inv
3765+
*/
37653766
void HoistFMulInLoopPass::combineNode(MulNode* node,
37663767
MulToNodeMapTy& nodeMap, bool isRoot)
37673768
{

IGC/Compiler/Optimizer/OpenCLPasses/OpenCLPrintf/OpenCLPrintfResolution.cpp

Lines changed: 97 additions & 97 deletions
Original file line numberDiff line numberDiff line change
@@ -61,51 +61,51 @@ const unsigned int PrintfBufferSize = 4 * MB;
6161
//
6262
// FORMAT OF PRINTF OUTPUT BUFFER:
6363
// ================================
64-
//
65-
//======================================================================
66-
//| DWORD bufferSize Size of the buffer in bytes | <-- This value is incremented by atomic_add
67-
//|====================================================================|
68-
//| DWORD stringIndex_ch_0 Index of format string for channel 0 | \
69-
//|--------------------------------------------------------------------| |
70-
//| DWORD data0Type Type identifier | |
71-
//|--------------------------------------------------------------------| |
72-
//| DWORD data0 Data for channel 0 | |
73-
//|--------------------------------------------------------------------| | Channel 0 data
74-
//| . . . . . . | |
75-
//|--------------------------------------------------------------------| |
76-
//| DWORD data1Type Type identifier | |
77-
//|--------------------------------------------------------------------| |
78-
//| DWORD data1 Data for channel 0 | /
79-
//|====================================================================|
80-
//| DWORD stringIndex_ch_1 Index of format string for channel 1 | \
81-
//|--------------------------------------------------------------------| |
82-
//| DWORD data0Type Type identifier | |
83-
//|--------------------------------------------------------------------| |
84-
//| DWORD data0 Data for channel 1 | |
85-
//|--------------------------------------------------------------------| | Channel 1 data
86-
//| . . . . . . | |
87-
//|--------------------------------------------------------------------| |
88-
//| DWORD data0Type Type identifier | |
89-
//|--------------------------------------------------------------------| |
90-
//| DWORD data1 Data for channel 1 | /
91-
//|====================================================================|
92-
//| . . . . . . |
93-
//| . . . . . . |
94-
//| . . . . . . |
95-
//|====================================================================|
96-
//| DWORD stringIndex_ch_N Index of format string for channel N | \
97-
//|--------------------------------------------------------------------| |
98-
//| DWORD data0Type Type identifier | |
99-
//|--------------------------------------------------------------------| |
100-
//| DWORD data0 Data for channel N | |
101-
//|--------------------------------------------------------------------| | Channel N data
102-
//| . . . . . . | |
103-
//|--------------------------------------------------------------------| |
104-
//| DWORD data0Type Type identifier | |
105-
//|--------------------------------------------------------------------| |
106-
//| DWORD data1 Data for channel N | /
107-
//|--------------------------------------------------------------------|
108-
64+
/*
65+
======================================================================
66+
| DWORD bufferSize Size of the buffer in bytes | <-- This value is incremented by atomic_add
67+
|====================================================================|
68+
| DWORD stringIndex_ch_0 Index of format string for channel 0 | \
69+
|--------------------------------------------------------------------| |
70+
| DWORD data0Type Type identifier | |
71+
|--------------------------------------------------------------------| |
72+
| DWORD data0 Data for channel 0 | |
73+
|--------------------------------------------------------------------| | Channel 0 data
74+
| . . . . . . | |
75+
|--------------------------------------------------------------------| |
76+
| DWORD data1Type Type identifier | |
77+
|--------------------------------------------------------------------| |
78+
| DWORD data1 Data for channel 0 | /
79+
|====================================================================|
80+
| DWORD stringIndex_ch_1 Index of format string for channel 1 | \
81+
|--------------------------------------------------------------------| |
82+
| DWORD data0Type Type identifier | |
83+
|--------------------------------------------------------------------| |
84+
| DWORD data0 Data for channel 1 | |
85+
|--------------------------------------------------------------------| | Channel 1 data
86+
| . . . . . . | |
87+
|--------------------------------------------------------------------| |
88+
| DWORD data0Type Type identifier | |
89+
|--------------------------------------------------------------------| |
90+
| DWORD data1 Data for channel 1 | /
91+
|====================================================================|
92+
| . . . . . . |
93+
| . . . . . . |
94+
| . . . . . . |
95+
|====================================================================|
96+
| DWORD stringIndex_ch_N Index of format string for channel N | \
97+
|--------------------------------------------------------------------| |
98+
| DWORD data0Type Type identifier | |
99+
|--------------------------------------------------------------------| |
100+
| DWORD data0 Data for channel N | |
101+
|--------------------------------------------------------------------| | Channel N data
102+
| . . . . . . | |
103+
|--------------------------------------------------------------------| |
104+
| DWORD data0Type Type identifier | |
105+
|--------------------------------------------------------------------| |
106+
| DWORD data1 Data for channel N | /
107+
|--------------------------------------------------------------------|
108+
*/
109109

110110
// For vector arguments, 2 type identifiers are used: 1st is SHADER_PRINTF_VECTOR_* and 2nd is the vector length.
111111
// These 2 type identifiers are followed by the elements of the vector.
@@ -342,58 +342,58 @@ static StoreInst* genStoreInternal(Value* Val, Value* Ptr, BasicBlock* InsertAtE
342342

343343
void OpenCLPrintfResolution::expandPrintfCall(CallInst& printfCall, Function& F)
344344
{
345-
// Replace a printf call with IR instructions that fill the rintf
346-
// output buffer created by the Runtime:
347-
// --------------------------------------------------------------------------
348-
// bufferPtr - pointer to the printf output buffer. This pointer
349-
// is an implicit kernel argument. It is loaded into
350-
// GRF as part of thread payload.
351-
// bufferSize - size of the printf output buffer. By agreement with
352-
// Runtime, it is 4 Mb.
353-
// dataSize - size of printf data for current thread.
354-
//
355-
// Note: we use STATELESS mode for printf buffer access.
356-
//---------------------------------------------------------------------------
357-
// writeOffset = atomic_add(bufferPtr, dataSize);
358-
// writePtr = bufferPtr + writeOffset;
359-
// endOffset = writeOffset + dataSize;
360-
// if (endOffset < bufferSize) { \
361-
// // Write the format string index |
362-
// *writePtr = stringIndex; |
363-
// writePtr += 4; |
364-
// |
365-
// // Write the argument type |
366-
// *writePtr = argument[1].dataType; |
367-
// writePtr += 4; |
368-
// // Write the argument value |
369-
// *writePtr = argument[1].value; |
370-
// writePtr += 4; | bblockTrue
371-
// . . . |
372-
// . . . |
373-
// // Write the argument type |
374-
// *writePtr = argument[N].dataType; |
375-
// writePtr += 4; |
376-
// // Write the argument value |
377-
// *writePtr = argument[N].value; |
378-
// writePtr += 4; |
379-
// |
380-
// // printf returns 0 if successful |
381-
// return_val = 0; /
382-
// }
383-
// else { \
384-
// // Check if the remaining output |
385-
// // buffer space is enough for writing |
386-
// //invalid string index. |
387-
// endOffset = writeOffset + 4; |
388-
// if (endOffset < bufferSize) { \ | bblockFalse
389-
// // Write the invalid string index. | bblockErrorString |
390-
// *writePtr = -1; | |
391-
// } / |
392-
// // printf returns -1 if failed |
393-
// return_val = -1; /
394-
// }
395-
// ----------------------------------------------------------------------
396-
345+
/* Replace a printf call with IR instructions that fill the rintf
346+
output buffer created by the Runtime:
347+
--------------------------------------------------------------------------
348+
bufferPtr - pointer to the printf output buffer. This pointer
349+
is an implicit kernel argument. It is loaded into
350+
GRF as part of thread payload.
351+
bufferSize - size of the printf output buffer. By agreement with
352+
Runtime, it is 4 Mb.
353+
dataSize - size of printf data for current thread.
354+
355+
Note: we use STATELESS mode for printf buffer access.
356+
---------------------------------------------------------------------------
357+
writeOffset = atomic_add(bufferPtr, dataSize);
358+
writePtr = bufferPtr + writeOffset;
359+
endOffset = writeOffset + dataSize;
360+
if (endOffset < bufferSize) { \
361+
// Write the format string index |
362+
*writePtr = stringIndex; |
363+
writePtr += 4; |
364+
|
365+
// Write the argument type |
366+
*writePtr = argument[1].dataType; |
367+
writePtr += 4; |
368+
// Write the argument value |
369+
*writePtr = argument[1].value; |
370+
writePtr += 4; | bblockTrue
371+
. . . |
372+
. . . |
373+
// Write the argument type |
374+
*writePtr = argument[N].dataType; |
375+
writePtr += 4; |
376+
// Write the argument value |
377+
*writePtr = argument[N].value; |
378+
writePtr += 4; |
379+
|
380+
// printf returns 0 if successful |
381+
return_val = 0; /
382+
}
383+
else { \
384+
// Check if the remaining output |
385+
// buffer space is enough for writing |
386+
//invalid string index. |
387+
endOffset = writeOffset + 4; |
388+
if (endOffset < bufferSize) { \ | bblockFalse
389+
// Write the invalid string index. | bblockErrorString |
390+
*writePtr = -1; | |
391+
} / |
392+
// printf returns -1 if failed |
393+
return_val = -1; /
394+
}
395+
----------------------------------------------------------------------
396+
*/
397397
MetaDataUtils* MdUtils = getAnalysis<MetaDataUtilsWrapper>().getMetaDataUtils();
398398
ImplicitArgs implicitArgs(F, MdUtils);
399399

visa/IGfxHwEuIsaCNL.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3000,9 +3000,9 @@ typedef union tagEU_INSTRUCTION_BASIC_THREE_SRC {
30003000
DWORD SourceDataType : BITFIELD_RANGE( 43, 45); // SOURCE_DATA_TYPE
30013001
DWORD DestinationDataType : BITFIELD_RANGE( 46, 48); // DESTINATION_DATA_TYPE
30023002

3003-
///*****************************************************************************\
3004-
//Four channel enables are defined for controlling which channels are written into the destination region. These channel mask bits are applied in a modulo-four manner to all ExecSize channels. There is 1-bit Channel Enable for each channel within the group of 4. If the bit is cleared, the write for the corresponding channel is disabled. If the bit is set, the write is enabled. Mnemonics for the bit being set for the group of 4 are -x -, -y -, -z -, and -w -, respectively, where -x - corresponds to Channel 0 in the group and -w - corresponds to channel 3 in the group
3005-
//\*****************************************************************************/
3003+
/*****************************************************************************\
3004+
Four channel enables are defined for controlling which channels are written into the destination region. These channel mask bits are applied in a modulo-four manner to all ExecSize channels. There is 1-bit Channel Enable for each channel within the group of 4. If the bit is cleared, the write for the corresponding channel is disabled. If the bit is set, the write is enabled. Mnemonics for the bit being set for the group of 4 are -x -, -y -, -z -, and -w -, respectively, where -x - corresponds to Channel 0 in the group and -w - corresponds to channel 3 in the group
3005+
\*****************************************************************************/
30063006
DWORD DestinationChannelEnable : BITFIELD_RANGE( 49, 52); // ChanEn[4]
30073007
DWORD DestinationSubregisterNumber : BITFIELD_RANGE( 53, 55); //
30083008
DWORD DestinationRegisterNumber_DestinationRegisterNumber : BITFIELD_RANGE( 0, 7); //

visa/LocalScheduler/G4_Sched.cpp

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1169,13 +1169,13 @@ static void mergeSegments(const std::vector<unsigned>& RPtrace,
11691169
assert(n >= 2);
11701170

11711171
// Starts with a local minimum.
1172-
//
1173-
// C /\
1174-
// / \
1175-
// A \ / \
1176-
// D \ / \
1177-
// B \/
1178-
//
1172+
/*
1173+
C /\
1174+
/ \
1175+
A \ / \
1176+
D \ / \
1177+
B \/
1178+
*/
11791179
if (Min[0] < Max[0]) {
11801180
unsigned Hi = RPtrace[0];
11811181
unsigned Lo = RPtrace[Min[0]];
@@ -1205,16 +1205,15 @@ static void mergeSegments(const std::vector<unsigned>& RPtrace,
12051205
}
12061206

12071207
// Starts with local maximum.
1208-
//
1209-
//
1210-
// D /\
1211-
// / \
1212-
// B /\ / \
1213-
// / \ / \
1214-
// C / \/
1215-
// /
1216-
// A /
1217-
//
1208+
/*
1209+
D /\
1210+
/ \
1211+
B /\ / \
1212+
/ \ / \
1213+
C / \/
1214+
/
1215+
A /
1216+
*/
12181217
unsigned Hi = RPtrace[Max[0]];
12191218
unsigned Lo = RPtrace[Min[0]];
12201219
for (unsigned i = 1; i < n; ++i) {

0 commit comments

Comments
 (0)