diff options
| author | Sanjay Patel <spatel@rotateright.com> | 2017-03-25 16:05:33 +0000 |
|---|---|---|
| committer | Sanjay Patel <spatel@rotateright.com> | 2017-03-25 16:05:33 +0000 |
| commit | 9ebb68843e57f2602cdec521cb8e55db5b1463a4 (patch) | |
| tree | 07ddd210f33c0bf5a742700f080998a9a1c606f5 /llvm/include | |
| parent | c3e5c3c5bc1e732a85cdbee9d55b561f6103c8a5 (diff) | |
| download | bcm5719-llvm-9ebb68843e57f2602cdec521cb8e55db5b1463a4.tar.gz bcm5719-llvm-9ebb68843e57f2602cdec521cb8e55db5b1463a4.zip | |
[x86] use PMOVMSK to replace memcmp libcalls for 16-byte equality
This is the payoff for D31156 - if a target has efficient comparison instructions for vector-sized equality,
we can replace memcmp calls with inline code that is both smaller and faster.
Differential Revision: https://reviews.llvm.org/D31290
llvm-svn: 298775
Diffstat (limited to 'llvm/include')
| -rw-r--r-- | llvm/include/llvm/Target/TargetLowering.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/include/llvm/Target/TargetLowering.h b/llvm/include/llvm/Target/TargetLowering.h index 59a2275d6a3..8f4c9adb780 100644 --- a/llvm/include/llvm/Target/TargetLowering.h +++ b/llvm/include/llvm/Target/TargetLowering.h @@ -437,6 +437,15 @@ public: return false; } + /// Return the preferred operand type if the target has a quick way to compare + /// integer values of the given size. Assume that any legal integer type can + /// be compared efficiently. Targets may override this to allow illegal wide + /// types to return a vector type if there is support to compare that type. + virtual MVT hasFastEqualityCompare(unsigned NumBits) const { + MVT VT = MVT::getIntegerVT(NumBits); + return isTypeLegal(VT) ? VT : MVT::INVALID_SIMPLE_VALUE_TYPE; + } + /// Return true if the target should transform: /// (X & Y) == Y ---> (~X & Y) == 0 /// (X & Y) != Y ---> (~X & Y) != 0 |

