[llvm-commits] PATCH: CONCAT_VECTORS expansion through the stack generated incorrect stack offsets, causing broken code to be generated

Duncan Sands baldrick at free.fr
Thu May 3 06:41:43 PDT 2012


Hi,

On 03/05/12 15:24, Heikki Kultala wrote:
> The expansion of CONCAT_VECTORS goes into
> SelectionDAGLegalize::ExpandVectorBuildThroughStack(SDNode* Node).
>
> The routine calculated the offsets of the stores from the size of the element
> size of the result vector. This works when the routine is used to expand
> BUILD_VECTOR of scalars, but it works incorrectly for CONCAT_VECTORS where one
> operand has bigger size than single element of the result vector.
>
> This patch fixes the store offsets to be calculated by the size of the input
> operands instead of the size of the elements in the result vectors.

can you please add a testcase.  Also, are you saying that the result element
type of CONCAT_VECTORS doesn't have to agree with the input element type, eg
that <4 x i32> concat_vectors <2 x i64>, <2 x i64> is possible?  If so, this
isn't documented in ISDOpcodes.h so can you please document it there.

> I hope this patch makes it into llvm 3.1 as this bug causes broken code to be
> generated on our code(tce).

It's probably too late, but you can always ask Bill (CC'd).

Ciao, Duncan.



More information about the llvm-commits mailing list