[LLVMbugs] [Bug 12772] New: CONCAT_VECTORS expansion creates broken code.

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed May 9 01:34:24 PDT 2012


             Bug #: 12772
           Summary: CONCAT_VECTORS expansion creates broken code.
           Product: libraries
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Common Code Generator Code
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: hkultala at cs.tut.fi
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 8518
  --> http://llvm.org/bugs/attachment.cgi?id=8518
patch for this bug. against llvm 3.1-svn

The expansion of CONCAT_VECTORS goes into
SelectionDAGLegalize::ExpandVectorBuildThroughStack(SDNode* Node).

This routine converts the expansion into multiple stores into stack and a load
from the stack.

This correctly stores the first vector into stack but the stack offset of the
second vector is incorrect and the store happens into wrong place, so some
elements of vector end up in wrong place and last element becomes total

This is because the stack offset is calculated by the size of the _element_ of
the vector instead of size of the stored data type (size of the _whole_
vector), so it breaks for CONCAT_VECTORS where input types are vectors.

The same routine is used expanding BUILD_VECTOR where it works correctly, as
the inputs of BUILD_VECTOR are always scalars, so the element size is same as
the whole data type size.

Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

More information about the llvm-bugs mailing list