[llvm] [LV] Teach LoopVectorizationLegality about struct vector calls (PR #119221)
David Sherwood via llvm-commits
llvm-commits at lists.llvm.org
Thu Dec 19 02:26:18 PST 2024
================
@@ -943,11 +955,24 @@ bool LoopVectorizationLegality::canVectorizeInstrs() {
if (CI && !VFDatabase::getMappings(*CI).empty())
VecCallVariantsFound = true;
+ auto canWidenInstruction = [this](Instruction const &Inst) {
+ Type *InstTy = Inst.getType();
+ if (isa<CallInst>(Inst) && isa<StructType>(InstTy) &&
+ canWidenCallReturnType(InstTy)) {
+ StructVecVecCallFound = true;
----------------
david-arm wrote:
I guess the alternative to having a new flag would be to look through all instructions in LoopVectorize::processLoop and bail out if we encounter types that return a structure. It's less efficient though.
It looks like the main goal here is to teach LoopVectorizationLegality that this type of operation is legal, but emit a message to show the vectoriser doesn't have the capability yet. Just trying to split up bigger patches to aid the review process and also getting some limited defence of the tests.
https://github.com/llvm/llvm-project/pull/119221
More information about the llvm-commits
mailing list