[PATCH] D140260: [LoopVectorize] Fix crash on "vector->scalar" bitcast vectorization

Mindong Chen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Dec 18 18:37:48 PST 2022


mdchen added a comment.

In D140260#4003727 <https://reviews.llvm.org/D140260#4003727>, @lebedev.ri wrote:

> It think the loop-invariantness precondition for these is overly restrictive.

Any suggestion on that?  IIUC there's also some inconsistency as the current legality check fails if `ExtractElementInst` is found:

  // Check that the instruction return type is vectorizable.
  // Also, we can't vectorize extractelement instructions.
  if ((!VectorType::isValidElementType(I.getType()) &&
       !I.getType()->isVoidTy()) ||
      isa<ExtractElementInst>(I)) {
    reportVectorizationFailure("Found unvectorizable type",
        "instruction return type cannot be vectorized",
        "CantVectorizeInstructionReturnType", ORE, TheLoop, &I);
    return false;
  }

which I suppose is uniform.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D140260/new/

https://reviews.llvm.org/D140260



More information about the llvm-commits mailing list