[PATCH] D110342: [x86] convert logic-of-FP-compares to FP logic-of-vector-compares

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 23 09:35:26 PDT 2021


spatel created this revision.
spatel added reviewers: pengfei, craig.topper, lebedev.ri, RKSimon.
Herald added subscribers: hiraditya, mcrosier.
spatel requested review of this revision.
Herald added a project: LLVM.

This is motivated by the examples and discussion in:
https://llvm.org/PR51245
...and related bugs.

By using vector compares and vector logic, we can convert 2 'set' instructions into 1 'movd' or 'movmsk' and generally improve throughput/reduce instructions.

Unfortunately, we don't have a complete vector compare ISA before AVX, so I left SSE-only out of this patch. Ie, we'd need extra logic ops to simulate the missing predicates for SSE 'cmpp*', so it's not as clearly a win.


https://reviews.llvm.org/D110342

Files:
  llvm/lib/Target/X86/X86ISelLowering.cpp
  llvm/test/CodeGen/X86/fcmp-logic.ll
  llvm/test/CodeGen/X86/lzcnt-zext-cmp.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D110342.374583.patch
Type: text/x-patch
Size: 8830 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210923/d3bf5d79/attachment.bin>


More information about the llvm-commits mailing list