Skip to content

Commit 08f5f6d

Browse files
[SPIR-V] Fix incorrect emission of G_SPLAT_VECTOR for fixed vectors (#108534)
This PR replaces MIRBuilder.buildSplatVector() by MIRBuilder.buildSplatBuildVector(), so that we emit G_BUILD_VECTOR instead of G_SPLAT_VECTOR: the latter is incorrect for fixed vectors and is limited to scalable vectors only.
1 parent e0a1637 commit 08f5f6d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/lib/Target/SPIRV/SPIRVGlobalRegistry.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,7 @@ Register SPIRVGlobalRegistry::getOrCreateIntCompositeOrNull(
496496
assignSPIRVTypeToVReg(SpvType, SpvVecConst, *CurMF);
497497
DT.add(CA, CurMF, SpvVecConst);
498498
if (EmitIR) {
499-
MIRBuilder.buildSplatVector(SpvVecConst, SpvScalConst);
499+
MIRBuilder.buildSplatBuildVector(SpvVecConst, SpvScalConst);
500500
} else {
501501
if (Val) {
502502
auto MIB = MIRBuilder.buildInstr(SPIRV::OpConstantComposite)

0 commit comments

Comments
 (0)