Skip to content

Commit 8417515

Browse files
jgu222sys_zuul
authored andcommitted
[Autobackout][FuncReg]Revert of change: 1f305a2
Try to replace isInSimdFlow() with isDivergent() by using a new function isAllLaneActive(). isInSimdFlow() has semantics meaning that all lanes (32) are active if isInSimdFlow() is false, that is, !isInSimdFlow() == NoMask. This is not equavalent to isDivergent(). Thus isAllLaneActive() is added to mimic !isInSimdFlow(). This change should have no effect on igc. It is not expected to affect CM either. Change-Id: Iad39a4e03cf97976bde9421fad158532999cc93e
1 parent f8a3881 commit 8417515

File tree

3 files changed

+7
-19
lines changed

3 files changed

+7
-19
lines changed

visa/FlowGraph.cpp

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5887,17 +5887,6 @@ void G4_BB::resetLocalId()
58875887
}
58885888
}
58895889

5890-
bool G4_BB::isAllLaneActive() const
5891-
{
5892-
G4_Kernel* pK = parent->getKernel();
5893-
if (pK->getIntKernelAttribute(Attributes::ATTR_Target) == VISA_CM && !isDivergent())
5894-
{
5895-
// CM: if BB isn't divergent, all lanes (32) must be active (dmask = 0xFFFFFFFF)
5896-
return true;
5897-
}
5898-
return false;
5899-
}
5900-
59015890
const char* G4_BB::getBBTypeStr() const
59025891
{
59035892
switch (getBBType()) {

visa/FlowGraph.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,6 @@ class G4_BB
426426
bool isInSimdFlow() const {return inSimdFlow;}
427427
void setDivergent(bool val) { divergent = val; }
428428
bool isDivergent() const { return divergent; }
429-
bool isAllLaneActive() const;
430429
unsigned getScopeID() { return scopeID; }
431430
void setScopeID(unsigned id) { scopeID = id; }
432431

visa/HWConformity.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ G4_Operand* HWConformity::insertMovBefore(
399399
// due to old BDW regioning rule we need NoMask inst here so they can be split
400400
if (builder.getOptions()->isTargetCM() && builder.getPlatform() == GENX_BDW)
401401
{
402-
if (!bb->isAllLaneActive())
402+
if (bb->isInSimdFlow())
403403
{
404404
newInstEMask = InstOpt_WriteEnable;
405405
}
@@ -1530,7 +1530,7 @@ bool HWConformity::fixDstAlignment( INST_LIST_ITER i, G4_BB* bb, G4_Type extype,
15301530

15311531
// optimize initialization instructions
15321532
if( inst->opcode() == G4_mov && src0->isImm() &&
1533-
( bb->isAllLaneActive() || inst->isWriteEnableInst() ) &&
1533+
( !bb->isInSimdFlow() || inst->isWriteEnableInst() ) &&
15341534
!inst->getPredicate() &&
15351535
dst->getRegAccess() == Direct &&
15361536
dst->getHorzStride() == 1 &&
@@ -2252,7 +2252,7 @@ bool HWConformity::fixMULInst( INST_LIST_ITER &i, G4_BB *bb )
22522252
if (next_dst != NULL &&
22532253
(next_inst->getSaturate() ||
22542254
next_dst->getByteOffset() % GENX_GRF_REG_SIZ != 0 ||
2255-
(!bb->isAllLaneActive() && next_inst->isWriteEnableInst() == false) ||
2255+
(bb->isInSimdFlow() && next_inst->isWriteEnableInst() == false) ||
22562256
(next_dst &&
22572257
((next_dst->getExecTypeSize() > G4_Type_Table[Type_D].byteSize) ||
22582258
isPreAssignedRegOffsetNonZero<G4_DstRegRegion>(next_dst)))))
@@ -5462,7 +5462,7 @@ void HWConformity::fixSADA2Inst(G4_BB* bb)
54625462
G4_INST* src2Dst = NULL;
54635463

54645464
int emask = inst->getMaskOption();
5465-
if (!bb->isAllLaneActive() &&
5465+
if (bb->isInSimdFlow() &&
54665466
emask != InstOpt_WriteEnable &&
54675467
inst->getMaskOffset() != 0)
54685468
{
@@ -6442,7 +6442,7 @@ bool HWConformity::splitInstListForByteDst( INST_LIST_ITER it, G4_BB *bb, uint16
64426442
// check if we can split the inst
64436443
if( !canSplitByteDst( inst_op ) ||
64446444
inst->getExecSize() == 1 ||
6445-
( !bb->isAllLaneActive() && !inst->isWriteEnableInst() ) ||
6445+
( bb->isInSimdFlow() && !inst->isWriteEnableInst() ) ||
64466446
dst->getByteOffset() % extypesize != 0 ||
64476447
dst->getHorzStride() != 1 ||
64486448
extypesize != G4_Type_Table[Type_W].byteSize)
@@ -6486,7 +6486,7 @@ bool HWConformity::splitInstListForByteDst( INST_LIST_ITER it, G4_BB *bb, uint16
64866486
}
64876487
if( canSplit )
64886488
{
6489-
if( !bb->isAllLaneActive() && !defInst->isWriteEnableInst() )
6489+
if( bb->isInSimdFlow() && !defInst->isWriteEnableInst() )
64906490
{
64916491
canSplit = false;
64926492
}
@@ -7806,7 +7806,7 @@ void HWConformity::fixPredCtrl(INST_LIST_ITER it, G4_BB* bb)
78067806
//
78077807
// if f0 happens to be < 16 elements we have to clear upper bits as well in case it has garbage values
78087808
assert(!inst->getCondMod() && "currently don't handle an instruction with conditional modifier");
7809-
assert((inst->isWriteEnableInst() || bb->isAllLaneActive()) && "don't handle instruction in SIMD CF for now");
7809+
assert((inst->isWriteEnableInst() || !bb->isInSimdFlow()) && "don't handle instruction in SIMD CF for now");
78107810
G4_Declare* tmpFlag = builder.createTempFlag(1);
78117811
G4_Type flagType = flagDcl->getNumberFlagElements() == 32 ? Type_UD : Type_UW;
78127812
uint32_t allOneMask = (uint32_t) ((1ULL << flagDcl->getNumberFlagElements()) - 1);

0 commit comments

Comments
 (0)