[llvm] [LoopVectorize] Check for vector-to-scalar casts in legalizer (PR #106244)

via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 27 12:36:27 PDT 2024


================
@@ -943,9 +943,12 @@ bool LoopVectorizationLegality::canVectorizeInstrs() {
         VecCallVariantsFound = true;
 
       // 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()) ||
+          (isa<CastInst>(&I) &&
----------------
ErikHogeman wrote:

Thanks, will fix.

https://github.com/llvm/llvm-project/pull/106244


More information about the llvm-commits mailing list