This is the exact same fix as in SVN r247254. In that commit, the fix was applied only for isVTRNMask and isVTRN_v_undef_Mask, but the same issue is present for VZIP/VUZP as well.
This fixes PR33921.
Differential D36899
[ARM] Check the right order for halves of VZIP/VUZP if both parts are used mstorsjo on Aug 18 2017, 2:24 PM. Authored by
Details
This is the exact same fix as in SVN r247254. In that commit, the fix was applied only for isVTRNMask and isVTRN_v_undef_Mask, but the same issue is present for VZIP/VUZP as well. This fixes PR33921.
Diff Detail Event TimelineComment Actions Understood the root cause better, with the hidden assumptions of isVZIPMask where both outputs are used. Comment Actions After digging in further, I found an even more elegant way of fixing it. And when expanding that fix to isVUZPMask and isVTRNMask, I noticed that the exact same fix as I was trying to provide already was present in isVTRNMask. So expanding that fix to all of them now, with the same code formatting style as in the existing check. Comment Actions Hi Martin, This makes sense to me. Thanks for the great investigation and getting to the bottom of it with such a simple patch. LGTM. cheers, Comment Actions Do you think it may be worthwhile to extract the operation into a function? static unsigned SelectPairHalf(unsigned Elements, ArrayRef<int> Mask, unsigned Index) { if (Mask.size() == Elements * 2) return Index / Elements; return Mask[Index] == 0 ? 0 : 1; } Comment Actions Hmm, maybe. I want this backported to 5.0 though, so I'd rather not to make too much factorization in the fix itself. Perhaps a separate factorization commit on top afterwards, that doesn't have to be backported? |