-
Notifications
You must be signed in to change notification settings - Fork 15.2k
Description
| 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.