1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 11:13:28 +01:00

[X86] combineX86ShufflesRecursively - fix use after move warning. NFCI.

After moving WidenedMask is in an undefined state, so reduce scope of the variable so its reinitialized every iteration - we should still retain any memory allocation savings.
This commit is contained in:
Simon Pilgrim 2020-09-20 14:06:50 +01:00
parent fe83462295
commit b9b03a71fd

View File

@ -36147,8 +36147,10 @@ static SDValue combineX86ShufflesRecursively(
// elements, and shrink them to the half-width mask. It does this in a loop // elements, and shrink them to the half-width mask. It does this in a loop
// so it will reduce the size of the mask to the minimal width mask which // so it will reduce the size of the mask to the minimal width mask which
// performs an equivalent shuffle. // performs an equivalent shuffle.
while (Mask.size() > 1) {
SmallVector<int, 64> WidenedMask; SmallVector<int, 64> WidenedMask;
while (Mask.size() > 1 && canWidenShuffleElements(Mask, WidenedMask)) { if (!canWidenShuffleElements(Mask, WidenedMask))
break;
Mask = std::move(WidenedMask); Mask = std::move(WidenedMask);
} }