return false;
}
-bool instr_reads_exec(const aco_ptr<Instruction>& instr)
-{
- return std::any_of(instr->operands.begin(), instr->operands.end(), [](const Operand &op) -> bool {
- return op.physReg() == exec_lo || op.physReg() == exec_hi;
- });
-}
-
bool instr_writes_exec(const aco_ptr<Instruction>& instr)
{
return std::any_of(instr->definitions.begin(), instr->definitions.end(), [](const Definition &def) -> bool {
/* VcmpxExecWARHazard
* Handle any VALU instruction writing the exec mask after it was read by a non-VALU instruction.
*/
- if (!instr->isVALU() && instr_reads_exec(instr)) {
+ if (!instr->isVALU() && instr->reads_exec()) {
ctx.has_nonVALU_exec_read = true;
} else if (instr->isVALU()) {
if (instr_writes_exec(instr)) {
};
bool pred_by_exec_mask(aco_ptr<Instruction>& instr) {
+ if (instr->isSALU())
+ return instr->reads_exec();
if (instr->format == Format::SMEM || instr->isSALU())
return false;
if (instr->format == Format::PSEUDO_BARRIER)
ctx.wqm = false;
}
- for (int i = block->instructions.size() - 1; i >= 0; --i)
- {
+ for (int i = block->instructions.size() - 1; i >= 0; --i) {
aco_ptr<Instruction>& instr = block->instructions[i];
WQMState needs = needs_exact(instr) ? Exact : Unspecified;
}
constexpr bool usesModifiers() const noexcept;
+
+ constexpr bool reads_exec() const noexcept
+ {
+ for (const Operand& op : operands) {
+ if (op.isFixed() && op.physReg() == exec)
+ return true;
+ }
+ return false;
+ }
};
struct SOPK_instruction : public Instruction {