[llvm] [LV] Teach LoopVectorizationLegality about struct vector calls (PR #119221)
Florian Hahn via llvm-commits
llvm-commits at lists.llvm.org
Thu Dec 19 14:42:23 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;
----------------
fhahn wrote:
Right I see there is an already a TODO to remove the `StructVecVecCallFound`, so as long as it is temporary that's sounds OK to me. It would be good if we could make this clear with a comment here as well to avoid confusion for future readers of the code, as in most cases the checks in LVL are directly tied to what we can generate code for.
Another alternative may worth considering is the future would be to bail out during VPlan construction if we encounter something that we cannot generate recipes for. There are a few cases where we already do that.
https://github.com/llvm/llvm-project/pull/119221
More information about the llvm-commits
mailing list