summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/CostModel.cpp
diff options
context:
space:
mode:
authorSimon Pilgrim <llvm-dev@redking.me.uk>2016-12-15 12:12:45 +0000
committerSimon Pilgrim <llvm-dev@redking.me.uk>2016-12-15 12:12:45 +0000
commit9876ed07f633af7702d4f06de8666a0a48c20fb6 (patch)
treed06576fc7ba7d99f65c7ca6996dc00e15d5eb269 /llvm/lib/Analysis/CostModel.cpp
parentec02b8d4c03e4c5cb9274fe35a1de1b80067ff2e (diff)
downloadbcm5719-llvm-9876ed07f633af7702d4f06de8666a0a48c20fb6.tar.gz
bcm5719-llvm-9876ed07f633af7702d4f06de8666a0a48c20fb6.zip
[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
Diffstat (limited to 'llvm/lib/Analysis/CostModel.cpp')
-rw-r--r--llvm/lib/Analysis/CostModel.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Analysis/CostModel.cpp b/llvm/lib/Analysis/CostModel.cpp
index 5dd54cd4d19..70b3560808c 100644
--- a/llvm/lib/Analysis/CostModel.cpp
+++ b/llvm/lib/Analysis/CostModel.cpp
@@ -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;
}
OpenPOWER on IntegriCloud