[PATCH] D61230: [X86][SSE] Optimize llvm.experimental.vector.reduce.xor.vXi1 parity reduction (PR38840)

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Apr 27 11:05:44 PDT 2019


RKSimon created this revision.
RKSimon added reviewers: craig.topper, spatel, efriedma, reames, gnzlbg.
Herald added a project: LLVM.

I think I've got this right.....

An xor reduction of a bool vector can be optimized to a parity check of the MOVMSK/BITCAST'd integer - if the population count is odd return 1, else return 0.

I haven't enabled POPCNT on any of the test targets, but I can if people think it useful (AVX1+ targets would always have POPCNT).


Repository:
  rL LLVM

https://reviews.llvm.org/D61230

Files:
  lib/Target/X86/X86ISelLowering.cpp
  test/CodeGen/X86/vector-reduce-xor-bool.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D61230.196978.patch
Type: text/x-patch
Size: 116860 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190427/ef567899/attachment-0001.bin>


More information about the llvm-commits mailing list