aco: form clauses for LDS instructions

No fossil-db changes.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25676>
This commit is contained in:
Daniel Schürmann 2024-01-04 12:58:14 +01:00 committed by Marge Bot
parent 8f16745821
commit 72a5c659d4
2 changed files with 8 additions and 1 deletions

View file

@ -1312,7 +1312,7 @@ should_form_clause(const Instruction* a, const Instruction* b)
return false;
/* Assume loads which don't use descriptors might load from similar addresses. */
if (a->isFlatLike())
if (a->isFlatLike() || a->accessesLDS())
return true;
if (a->isSMEM() && a->operands[0].bytes() == 8 && b->operands[0].bytes() == 8)
return true;

View file

@ -1287,6 +1287,7 @@ struct Instruction {
constexpr bool isVMEM() const noexcept { return isMTBUF() || isMUBUF() || isMIMG(); }
bool accessesLDS() const noexcept;
bool isTrans() const noexcept;
};
static_assert(sizeof(Instruction) == 16, "Unexpected padding");
@ -1674,6 +1675,12 @@ struct Pseudo_reduction_instruction : public Instruction {
static_assert(sizeof(Pseudo_reduction_instruction) == sizeof(Instruction) + 4,
"Unexpected padding");
inline bool
Instruction::accessesLDS() const noexcept
{
return (isDS() && !ds().gds) || isLDSDIR() || isVINTRP();
}
inline void
VALU_instruction::swapOperands(unsigned idx0, unsigned idx1)
{