[PATCH] D41139: [SLPVectorizer] Don't ignore scalar extraction instructions of aggregate value

Hal Finkel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 12 19:22:47 PST 2017


hfinkel accepted this revision.
hfinkel added a comment.
This revision is now accepted and ready to land.

The current code generation is also odd on x86 (for the same reason). Returning the aggregate forces the values to be placed in specific GPRs. That makes the vectorization not worthwhile. Can you please also add this test into the X86 directory (running for x86, obviously) as well?

There might be cases where this is not the right thing to do, but nothing comes to mind at the moment. LGTM.



================
Comment at: lib/Transforms/Vectorize/SLPVectorizer.cpp:5715
+  // Aggregate value is unlikely to be processed in vector register, we need to
+  // extract scalars into integer registers, so NeedExtraction is set true.
+  return tryToVectorizeList(BuildVectorOpds, R, BuildVector, false, true);
----------------
I'd say "scalar registers" instead of "integer registers" (they might, for example, be floating-point registers).


https://reviews.llvm.org/D41139





More information about the llvm-commits mailing list