Skip to content

Commit 797fc52

Browse files
weiyu-chenigcbot
authored andcommitted
Enable accumulator usage for sel instruction.
1 parent d462a93 commit 797fc52

File tree

2 files changed

+16
-8
lines changed

2 files changed

+16
-8
lines changed

visa/AccSubstitution.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ bool AccSubPass::isAccCandidate(G4_INST* inst, int& lastUse, bool& mustBeAcc0, i
441441
return false;
442442
}
443443

444-
if (inst->getCondMod())
444+
if (inst->hasCondModWithFlag())
445445
{
446446
// since our du-chain is on inst instead of operand, the presence of conditional modifier complicates the checks later.
447447
// This is somewhat conservative but shouldn't matter too much as inst with both dst and conditional modifiers are rare.

visa/Gen4_IR.hpp

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -918,13 +918,16 @@ typedef struct _SWSBInfo
918918
// add (8|M8) ...
919919
// will have 0xFF00, which lane 8-15
920920
uint32_t getExecLaneMask() const;
921-
G4_ExecSize getExecSize() const {return execSize;}
922-
const G4_CondMod* getCondMod() const {return mod;}
923-
G4_CondMod* getCondMod() {return mod;}
924-
const G4_VarBase* getCondModBase() const;
925-
G4_VarBase* getCondModBase() {
926-
return const_cast<G4_VarBase*>(((const G4_INST*)this)->getCondModBase());
927-
}
921+
G4_ExecSize getExecSize() const { return execSize; }
922+
923+
const G4_CondMod* getCondMod() const { return mod; }
924+
G4_CondMod* getCondMod() { return mod; }
925+
const G4_VarBase* getCondModBase() const;
926+
G4_VarBase* getCondModBase() {
927+
return const_cast<G4_VarBase*>(((const G4_INST*)this)->getCondModBase());
928+
}
929+
bool hasCondModWithFlag() const;
930+
928931
void setCondMod(G4_CondMod* m);
929932

930933
bool isDead() const {return dead;}
@@ -4205,6 +4208,11 @@ inline G4_Declare *G4_Operand::getBaseRegVarRootDeclare() const
42054208
return getBase()->asRegVar()->getDeclare()->getRootDeclare();
42064209
}
42074210

4211+
inline bool G4_INST::hasCondModWithFlag() const
4212+
{
4213+
return mod && mod->getBase();
4214+
}
4215+
42084216
} // namespace vISA
42094217

42104218
#endif

0 commit comments

Comments
 (0)