Skip to content

Commit b09a6e8

Browse files
fda0Dmitry Sidorov
andauthored
[Backport to LLVM 16] Fix TopologicalSort for Joint and Cooperative matrices (KhronosGroup#2143) (KhronosGroup#3242)
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. For example: TypeCooperativeMatrixKHR %ID% TypeStruct ... %ID% is the correct order, but without the patch in some cases the translator could generate the opposite order. Signed-off-by: Sidorov, Dmitry <dmitry.sidorov@intel.com> (cherry picked from commit 436c497) Signed-off-by: Sidorov, Dmitry <dmitry.sidorov@intel.com> Co-authored-by: Dmitry Sidorov <dmitry.sidorov@intel.com>
1 parent d618c7b commit b09a6e8

File tree

2 files changed

+441
-0
lines changed

2 files changed

+441
-0
lines changed

lib/SPIRV/libSPIRV/SPIRVType.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1157,6 +1157,10 @@ class SPIRVTypeCooperativeMatrixKHR : public SPIRVType {
11571157
SPIRVValue *getRows() const { return Args[1]; }
11581158
SPIRVValue *getColumns() const { return Args[2]; }
11591159
SPIRVValue *getUse() const { return Args[3]; }
1160+
1161+
std::vector<SPIRVEntry *> getNonLiteralOperands() const override {
1162+
return std::vector<SPIRVEntry *>(1, CompType);
1163+
}
11601164
};
11611165

11621166
} // namespace SPIRV

0 commit comments

Comments
 (0)