[llvm] [LV] Add initial support for vectorizing literal struct return values (PR #109833)
David Sherwood via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 14 03:42:18 PST 2025
================
@@ -4620,7 +4620,8 @@ static bool willGenerateVectors(VPlan &Plan, ElementCount VF,
Type *ScalarTy = TypeInfo.inferScalarType(ToCheck);
if (!Visited.insert({ScalarTy}).second)
continue;
- if (WillWiden(ScalarTy))
+ Type *WideTy = toVectorizedTy(ScalarTy, VF);
+ if (any_of(getContainedTypes(WideTy), WillWiden))
----------------
david-arm wrote:
I think this should be `all_of`. Right now we don't support vectorising calls that return structs with different sized element types. However, we may add support in future and that would require all of them to be profitable to widen I think? For example, let's suppose a call instruction returns { i32, i256 } then if your vector register is only 128 bits wide you'd need two registers to hold the i256 value. So it would be fine to vectorise the i32 type, but not the i256.
https://github.com/llvm/llvm-project/pull/109833
More information about the llvm-commits
mailing list