[llvm] [Scalarizer][DirectX] support structs return types (PR #111569)
Tex Riddell via llvm-commits
llvm-commits at lists.llvm.org
Thu Oct 17 13:04:05 PDT 2024
================
@@ -699,6 +730,22 @@ bool ScalarizerVisitor::splitCall(CallInst &CI) {
if (isVectorIntrinsicWithOverloadTypeAtArg(ID, -1))
Tys.push_back(VS->SplitTy);
+ if (AreAllMatchingVectors) {
+ Type *PrevType = CallType->getContainedType(0);
+ for (unsigned I = 1; I < CallType->getNumContainedTypes(); I++) {
+ Type *CurrType = cast<FixedVectorType>(CallType->getContainedType(I));
+ if (PrevType != CurrType) {
----------------
tex3d wrote:
Wait, I was confused thinking this was comparing equal. So, `frexp` returns two different vector types. The prior call to `isVectorIntrinsicWithOverloadTypeAtArg` determines whether the first type is part of the overload, but then we assume any other types in the return that don't match the first one are also part of the overload type. That doesn't sound right for the general case either.
Since we don't actually ensure that they match, we could have a situation where `NumPacked` differs between returned vector types, which would be a problem. This was checked for arguments, bailing if they differ, but we aren't checking this for the return values. I think we need to do that as well.
https://github.com/llvm/llvm-project/pull/111569
More information about the llvm-commits
mailing list