[PATCH] D42100: Fix codegen of stores of vectors with non byte-sized elements.

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 19 11:17:47 PST 2018


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

LGTM

> So it is not really true that there could be a general assert since this is actually even expected, or? I don't think I have a patch for this, then.

That code is specifically dealing with an EXTRACT_VECTOR_ELT from a BUILD_VECTOR; in that case, before type legalization is finished, you could have a mix of types: either the BUILD_VECTOR operand type could be wider than the EXTRACT_VECTOR_ELT result, or the EXTRACT_VECTOR_ELT result type could be wider than the BUILD_VECTOR operand.  But they should both be at least as wide as the vector element type.



================
Comment at: lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp:2017
+  // Scalarize if elements and the split halves are not byte-sized.
+  if (!MemoryVT.getScalarType().isByteSized() &&
+      (!LoMemVT.isByteSized() || !HiMemVT.isByteSized()))
----------------
I think the "MemoryVT.getScalarType().isByteSized()" check is redundant.  Not a big deal either way.


================
Comment at: lib/CodeGen/SelectionDAG/TargetLowering.cpp:3471
+  unsigned Stride = MemSclVT.getSizeInBits() / 8;
+  assert (Stride && "Zero stride!");
+
----------------
Extra space after assert.


https://reviews.llvm.org/D42100





More information about the llvm-commits mailing list