[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 14:44:59 PDT 2017


efriedma added inline comments.


================
Comment at: lib/Target/X86/X86ISelLowering.cpp:4646
+  // PMOVMSKB can handle this.
+  if (Subtarget.hasSSE2() && NumBits == 128)
+    return MVT::v16i8;
----------------
Maybe check isTypeLegal(MVT::v16i8) instead?  hasSSE2() doesn't mean what you want it to.


================
Comment at: lib/Target/X86/X86ISelLowering.cpp:4650
+  // TODO: 256- and 512-bit types should be allowed, but make sure that those
+  // cases are handled in combineVectorSizedSetCCEquality().
+
----------------
Maybe also 64-bit types (on a 32-bit target).


================
Comment at: test/CodeGen/X86/memcmp.ll:2
 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown | FileCheck %s
 
----------------
Could you regenerate this test so it also compiles for a 32-bit target?


https://reviews.llvm.org/D31290





More information about the llvm-commits mailing list