[PATCH] D31290: [x86] use PMOVMSK to replace memcmp libcalls for 16-byte equality

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 24 12:02:20 PDT 2017


efriedma added a comment.

> Not sure if this specialization still makes sense given that patch, but since I already made the edits, I'll post it.

Even with that patch, we probably still want a similar target hook.  Might as well finish/merge this now, then make sure we continue to generate the same efficient code when x86 transitions to the new memcmp lowering.



================
Comment at: lib/Target/X86/X86ISelLowering.h:819
+    /// Vector-sized comparisons are fast using PCMPEQ + PMOVMSK or PTEST.
+    bool hasFastEqualityCompare(EVT VT) const override;
+    
----------------
It probably makes sense to make this take a size in bytes, and return a VT, rather than calling this with every possible VT.


https://reviews.llvm.org/D31290





More information about the llvm-commits mailing list