Skip to content

Commit

Permalink
[X86] lowerV8I16Shuffle - use explicit SmallVector<SDValue, 4> width …
Browse files Browse the repository at this point in the history
…to avoid MSVC AVX alignment bug

As discussed on Issue #54645 - building llc with /AVX can result in incorrectly aligned structs
  • Loading branch information
RKSimon committed Apr 1, 2022
1 parent a5a598b commit cb5c4a5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion llvm/lib/Target/X86/X86ISelLowering.cpp
Expand Up @@ -15838,7 +15838,8 @@ static SDValue lowerV8I16Shuffle(const SDLoc &DL, ArrayRef<int> Mask,
V1 = extract128BitVector(V1V2, 0, DAG, DL);
V2 = extract128BitVector(V1V2, 4, DAG, DL);
} else {
SmallVector<SDValue> DWordClearOps(4, DAG.getConstant(0, DL, MVT::i32));
SmallVector<SDValue, 4> DWordClearOps(4,
DAG.getConstant(0, DL, MVT::i32));
for (unsigned i = 0; i != 4; i += 1 << (NumEvenDrops - 1))
DWordClearOps[i] = DAG.getConstant(0xFFFF, DL, MVT::i32);
SDValue DWordClearMask =
Expand Down

0 comments on commit cb5c4a5

Please sign in to comment.