[llvm] [LV] Add initial support for vectorizing literal struct return values (PR #109833)
Benjamin Maxwell via llvm-commits
llvm-commits at lists.llvm.org
Wed Dec 4 08:25:52 PST 2024
================
@@ -946,8 +946,8 @@ bool LoopVectorizationLegality::canVectorizeInstrs() {
// Check that the instruction return type is vectorizable.
// We can't vectorize casts from vector type to scalar type.
// Also, we can't vectorize extractelement instructions.
- if ((!VectorType::isValidElementType(I.getType()) &&
- !I.getType()->isVoidTy()) ||
+ Type *InstTy = I.getType();
+ if (!(InstTy->isVoidTy() || canWidenType(InstTy)) ||
----------------
MacDue wrote:
I've added two extra tests with `load` and `store` instructions, and updated the check in `LoopVectorizationLegality.cpp` to only allow widening calls that return structs, where all users are `extractvalue`.
This is all we need for this initial patch (we could maybe generalize this more in future patches).
https://github.com/llvm/llvm-project/pull/109833
More information about the llvm-commits
mailing list