summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorSanjay Patel <spatel@rotateright.com>2017-03-28 17:23:49 +0000
committerSanjay Patel <spatel@rotateright.com>2017-03-28 17:23:49 +0000
commitf01a1dad7f369399cbe21a94d5c33a9be2c9c512 (patch)
treeef169d078f91af052ac58af44af09b59442ead07 /llvm/lib/CodeGen
parentda4d12a8e563d3f50ca3ce3243720fe30f77523f (diff)
downloadbcm5719-llvm-f01a1dad7f369399cbe21a94d5c33a9be2c9c512.tar.gz
bcm5719-llvm-f01a1dad7f369399cbe21a94d5c33a9be2c9c512.zip
[x86] use VPMOVMSK to replace memcmp libcalls for 32-byte equality
Follow-up to: https://reviews.llvm.org/rL298775 llvm-svn: 298933
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
index 25523e52af1..9a4d44842ea 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
@@ -6069,20 +6069,20 @@ bool SelectionDAGBuilder::visitMemCmpCall(const CallInst &I) {
// supports the MVT we'll be loading or if it is small enough (<= 4) that
// we'll only produce a small number of byte loads.
MVT LoadVT;
- switch (CSize->getZExtValue()) {
+ unsigned NumBitsToCompare = CSize->getZExtValue() * 8;
+ switch (NumBitsToCompare) {
default:
return false;
- case 2:
+ case 16:
LoadVT = MVT::i16;
break;
- case 4:
+ case 32:
LoadVT = MVT::i32;
break;
- case 8:
- LoadVT = hasFastLoadsAndCompare(64);
- break;
- case 16:
- LoadVT = hasFastLoadsAndCompare(128);
+ case 64:
+ case 128:
+ case 256:
+ LoadVT = hasFastLoadsAndCompare(NumBitsToCompare);
break;
}
OpenPOWER on IntegriCloud