[PATCH] D42379: [DAGCombiner] Bail out if vector size is not a multiple

Sven van Haastregt via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 22 09:19:54 PST 2018


svenvh added inline comments.


================
Comment at: lib/CodeGen/SelectionDAG/DAGCombiner.cpp:15191
 
+      // Bail out if the vector size is not a multiple of the scalar size.
+      if (VT.getSizeInBits() % SclTy.getSizeInBits())
----------------
RKSimon wrote:
> "Bail out if the output vector size is not a multiple of the input vector size."
> 
> Shouldn't this be pulled out to near the top of the method?
> 
> FoldCONCAT_VECTORS actually treats this as an assert - is there anyway that you can cause it to fire there?

Not sure if "input vector size" is correct here; we want the output vector size to be a multiple of the scalar size that we input to scalar_to_vector.  We only know the scalar size around this point in the code (after deciding whether to look through the trunc).

The concat_vector in itself is fine; which assert in FoldCONCAT_VECTORS do you expect to fire?


https://reviews.llvm.org/D42379





More information about the llvm-commits mailing list