Skip to content

Bugs in handling of i1 vectors + memory #27974

@frasercrmck

Description

@frasercrmck
Bugzilla Link 27600
Version trunk
OS Linux
Blocks #30613
CC @hfinkel,@RKSimon,@rotateright

Extended Description

I've come across several problems in the treatment of i1 vectors in expansion and DAG combining code.

They, so far, all concern the assumption that vector element types are of size > 1 byte.

The first few are in the expansion of build/extract/insert vector when expanding through the stack:

SDValue SelectionDAGLegalize::ExpandVectorBuildThroughStack(SDNode* Node) {
unsigned TypeByteSize = EltVT.getSizeInBits() / 8; -- Zero

for (unsigned i = 0, e = Node->getNumOperands(); i != e; ++i) {
unsigned Offset = TypeByteSize*i; // Always zero!

This means the offset from the stack is always 0, hence it'll load the wrong element.

Same goes with ExpandExtractFromVectorThroughStack and ExpandInsertToVectorThroughStack, from what I can see by reading the code.

Also buggy is DAGCombiner::ReplaceExtractVectorEltOfLoadWithNarrowedLoad. Same problem - offsets of zero, combining to incorrect DAG result.

I haven't seen any more just yet, but I'll update this issue tracker if I find more.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions