Skip to content

Commit

Permalink
Fix TopologicalSort for Joint and Cooperative matrices
Browse files Browse the repository at this point in the history
visit method of the sort relies on getNonLiteralOperands method of the
SPIRVType which is being inserted in the module. Without it dependent
types can be inserted in the module in incorrect order.

Signed-off-by: Sidorov, Dmitry <dmitry.sidorov@intel.com>
  • Loading branch information
MrSidims committed Sep 1, 2023
1 parent d100186 commit 02026e9
Show file tree
Hide file tree
Showing 3 changed files with 881 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/SPIRV/libSPIRV/SPIRVType.h
Original file line number Diff line number Diff line change
Expand Up @@ -1114,6 +1114,10 @@ class SPIRVTypeJointMatrixINTEL : public SPIRVType {
return Args.size() > 5 ? Args[5] : nullptr;
return Args.size() > 4 ? Args[4] : nullptr;
}

std::vector<SPIRVEntry *> getNonLiteralOperands() const override {
return std::vector<SPIRVEntry *>(1, CompType);
}
};

class SPIRVTypeCooperativeMatrixKHR : public SPIRVType {
Expand Down Expand Up @@ -1142,6 +1146,10 @@ class SPIRVTypeCooperativeMatrixKHR : public SPIRVType {
SPIRVValue *getRows() const { return Args[1]; }
SPIRVValue *getColumns() const { return Args[2]; }
SPIRVValue *getUse() const { return Args[3]; }

std::vector<SPIRVEntry *> getNonLiteralOperands() const override {
return std::vector<SPIRVEntry *>(1, CompType);
}
};

} // namespace SPIRV
Expand Down
Loading

0 comments on commit 02026e9

Please sign in to comment.