Skip to content

Commit 3b80a28

Browse files
authored
[mlir][spirv] Fix incorrect metadata in SPIR-V Header (#104242)
SRIP-V Generator Magic Number is a 32 bit word: The high order 16 bits are a tool ID. The low order 16 bits are for verion number, currently the tool id is not on the high order 16 bit so it must shifed fixes: #99071
1 parent 22b4496 commit 3b80a28

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mlir/lib/Target/SPIRV/SPIRVBinaryUtils.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ void spirv::appendModuleHeader(SmallVectorImpl<uint32_t> &header,
5252
// +-------------------------------------------------------------------------+
5353
header.push_back(spirv::kMagicNumber);
5454
header.push_back((majorVersion << 16) | (minorVersion << 8));
55-
header.push_back(kGeneratorNumber);
55+
header.push_back((kGeneratorNumber << 16) | LLVM_VERSION_MAJOR);
5656
header.push_back(idBound); // <id> bound
5757
header.push_back(0); // Schema (reserved word)
5858
}

0 commit comments

Comments
 (0)