@@ -3099,8 +3099,9 @@ void CFGStructurizer::convertIf(ANodeHG *node, G4_BB *nextJoinBB)
3099
3099
MUST_BE_TRUE (end->getPhysicalSucc () == exit,
3100
3100
" Landing BB should have been inserted during construction of hammock graph" );
3101
3101
3102
+ bool isUniform = isGotoScalarJmp (gotoInst);
3102
3103
ANodeKind kind = ANKIND_GOTOJOIN;
3103
- if (doScalarJmp && isGotoScalarJmp (gotoInst) )
3104
+ if (doScalarJmp && isUniform )
3104
3105
{
3105
3106
kind = ANKIND_JMPI;
3106
3107
}
@@ -3201,6 +3202,10 @@ void CFGStructurizer::convertIf(ANodeHG *node, G4_BB *nextJoinBB)
3201
3202
gotoInst->getLineNo (), gotoInst->getCISAOff (), gotoInst->getSrcFilename ());
3202
3203
begin->pop_back ();
3203
3204
begin->push_back (ifInst);
3205
+ if (isUniform)
3206
+ {
3207
+ ifInst->asCFInst ()->setUniform (true );
3208
+ }
3204
3209
3205
3210
if (thenNode->isHammock ())
3206
3211
{
@@ -3339,6 +3344,10 @@ void CFGStructurizer::convertIf(ANodeHG *node, G4_BB *nextJoinBB)
3339
3344
newThenLastBB->pop_back ();
3340
3345
}
3341
3346
newThenLastBB->push_back (elseInst);
3347
+ if (isUniform)
3348
+ {
3349
+ ifInst->asCFInst ()->setUniform (true );
3350
+ }
3342
3351
3343
3352
(void )convertPST (thenNode, node->getHasBreak () ? newThenLastBB : nullptr );
3344
3353
@@ -3383,8 +3392,9 @@ void CFGStructurizer::convertDoWhile(ANodeHG *node, G4_BB *nextJoinBB)
3383
3392
// need to check it out to avoid generating them.
3384
3393
//
3385
3394
3395
+ bool isUniform = isGotoScalarJmp (gotoInst);
3386
3396
ANodeKind ndkind = ANKIND_GOTOJOIN;
3387
- if (doScalarJmp && isGotoScalarJmp (gotoInst) &&
3397
+ if (doScalarJmp && isUniform &&
3388
3398
(!doStructCF || !node->getHasBreak ()))
3389
3399
{
3390
3400
// If loop has break, favor structured CF, not jmpi
@@ -3419,6 +3429,10 @@ void CFGStructurizer::convertDoWhile(ANodeHG *node, G4_BB *nextJoinBB)
3419
3429
gotoInst->getLineNo (), gotoInst->getCISAOff (), gotoInst->getSrcFilename ());
3420
3430
end->pop_back ();
3421
3431
end->push_back (whileInst);
3432
+ if (isUniform)
3433
+ {
3434
+ whileInst->asCFInst ()->setUniform (true );
3435
+ }
3422
3436
3423
3437
convertChildren (node, node->getHasBreak () ? end : nullptr );
3424
3438
}
@@ -3451,7 +3465,6 @@ void CFGStructurizer::generateGotoJoin(G4_BB *gotoBB, G4_BB *jibBB, G4_BB *joinB
3451
3465
uint8_t execSize = gotoInst->getExecSize ();
3452
3466
execSize = execSize > 1 ? execSize : kernelExecSize;
3453
3467
3454
-
3455
3468
if (gotoInst->getExecSize () == 1 )
3456
3469
{ // For simd1 goto, convert it to a goto with the right execSize.
3457
3470
gotoInst->setExecSize (execSize);
@@ -3505,6 +3518,7 @@ void CFGStructurizer::convertGoto(ANodeBB *node, G4_BB *nextJoinBB)
3505
3518
}
3506
3519
node->setVisited (true );
3507
3520
3521
+ bool isUniform = isGotoScalarJmp (gotoInst);
3508
3522
G4_BB *exitbb = node->getExitBB ();
3509
3523
ANodeHG *innermostWhile = getInnerMostWhile (node);
3510
3524
ANodeKind kind = ANKIND_GOTOJOIN;
@@ -3520,7 +3534,7 @@ void CFGStructurizer::convertGoto(ANodeBB *node, G4_BB *nextJoinBB)
3520
3534
// nextJoinBB, if any, must be after getBeginBB(). So, if nextJoinBB
3521
3535
// is before exitbb, nextJoinBB is in the middle of [beginbb, exitbb]
3522
3536
bool hasJoinInMiddle = nextJoinBB && isBefore (nextJoinBB, exitbb);
3523
- if (doScalarJmp && isGotoScalarJmp (gotoInst) &&
3537
+ if (doScalarJmp && isUniform &&
3524
3538
(gotoInst->asCFInst ()->isBackward () || !hasJoinInMiddle))
3525
3539
{
3526
3540
kind = ANKIND_JMPI;
@@ -3599,6 +3613,10 @@ void CFGStructurizer::convertGoto(ANodeBB *node, G4_BB *nextJoinBB)
3599
3613
gotoInst->getSrcFilename ());
3600
3614
beginbb->pop_back ();
3601
3615
beginbb->push_back (breakInst);
3616
+ if (isUniform)
3617
+ {
3618
+ breakInst->asCFInst ()->setUniform (true );
3619
+ }
3602
3620
return ;
3603
3621
}
3604
3622
0 commit comments