[all-commits] [llvm/llvm-project] 6997f4: [X86] combineSetCCMOVMSK - fold allof(cmpeq(x, y)) ...
Simon Pilgrim via All-commits
all-commits at lists.llvm.org
Mon Jan 24 08:55:02 PST 2022
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 6997f4d07fa4b462dd3a02838a2cfed45db9c8a0
https://github.com/llvm/llvm-project/commit/6997f4d07fa4b462dd3a02838a2cfed45db9c8a0
Author: Simon Pilgrim <llvm-dev at redking.me.uk>
Date: 2022-01-24 (Mon, 24 Jan 2022)
Changed paths:
M llvm/lib/Target/X86/X86ISelLowering.cpp
M llvm/test/CodeGen/X86/movmsk-cmp.ll
M llvm/test/CodeGen/X86/vector-compare-all_of.ll
M llvm/test/CodeGen/X86/vector-compare-any_of.ll
M llvm/test/CodeGen/X86/vector-reduce-and-bool.ll
Log Message:
-----------
[X86] combineSetCCMOVMSK - fold allof(cmpeq(x,y)) -> ptest(sub(x,y)) (PR53379)
As suggested on PR53379, for all-of icmp-eq patterns, we can use ptest(sub(x,y)) on SSE41+ targets
This is a generalization of the existing allof(cmpeq(x,0)) -> ptest(x) pattern
We can probably extend this further, in particularly to handle 256-bit cases on pre-AVX2 targets, but this part of the generalization is pretty trivial
Fixes Issue #53379
More information about the All-commits
mailing list