[CostModel] Fix long standing bug with reverse shuffle mask detection

Incorrect 'undef' mask index matching meant that broadcast shuffles could be detected as reverse shuffles

llvm-svn: 289811
This commit is contained in:
Simon Pilgrim
2016-12-15 12:12:45 +00:00
parent ec02b8d4c0
commit 9876ed07f6
2 changed files with 32 additions and 1 deletions

View File

@@ -92,7 +92,7 @@ CostModelAnalysis::runOnFunction(Function &F) {
static bool isReverseVectorMask(SmallVectorImpl<int> &Mask) {
for (unsigned i = 0, MaskSize = Mask.size(); i < MaskSize; ++i)
if (Mask[i] > 0 && Mask[i] != (int)(MaskSize - 1 - i))
if (Mask[i] >= 0 && Mask[i] != (int)(MaskSize - 1 - i))
return false;
return true;
}