[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
Thu Mar 23 12:40:29 PDT 2017

efriedma added inline comments.

Comment at: lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp:6098
+  LHSVal = DAG.getBitcast(CmpVT, LHSVal);
+  RHSVal = DAG.getBitcast(CmpVT, RHSVal);
What's the point of performing the load in a vector type if you're going to immediately bitcast the result to an integer type?  IIRC DAGCombine will fold this away.

Comment at: test/CodeGen/X86/memcmp.ll:104
+; CHECK-NEXT:    pmovmskb %xmm1, %eax
+; CHECK-NEXT:    cmpl $65535, %eax # imm = 0xFFFF
 ; CHECK-NEXT:    setne %al
What's the performance of this compared to using integer registers?  (movq+xorq+movq+xorq+orq).


More information about the llvm-commits mailing list