LICM: fix a wrong tuple type when splitting loads

When creating a tuple, the type needs to be specified because otherwise, if the original tuple has labels, it will cause a type mismatch verification error.

rdar://152588539
This commit is contained in:
Erik Eckstein
2025-06-04 19:58:56 +02:00
parent dd57d4dd85
commit cbbf33dc55
2 changed files with 32 additions and 1 deletions

View File

@@ -1148,7 +1148,7 @@ SingleValueInstruction *LoopTreeOptimization::splitLoad(
}
elements.push_back(elementVal);
}
return builder.createTuple(loc, elements);
return builder.createTuple(loc, loadTy.getObjectType(), elements);
}
auto structTy = loadTy.getStructOrBoundGenericStruct();
assert(structTy && "tuple and struct elements are checked earlier");