[PATCH] D43137: [X86] Change signatures of avx512 packed fp compare intrinsics to return a vXi1 mask type to be closer to an fcmp.

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 9 11:35:41 PST 2018


craig.topper created this revision.
craig.topper added reviewers: spatel, delena, RKSimon, zvi.

This patch changes the signature of the avx512 packed fp compare intrinsics to return a vXi1 vector and no longer take a mask as input. The casts to scalar type will now need to be explicit in the IR. The masking node will now be an explicit and in the IR.

This makes the intrinsic look much more similar to an fcmp instruction that we wish we could use for these but can't. We already use icmp instructions for integer compares.

Previously the lowering step of isel would turn the intrinsic into an X86 specific ISD node and a emit the masking nodes as well as some bitcasts. This means DAG combines can't see the vXi1 type until somewhat late, making it more difficult to combine out gpr<->mask transition sequences. By exposing the vXi1 type explicitly in the IR and initial SelectionDAG we give earlier DAG combines and even InstCombine the chance to see it and optimize it.

This should make any issues with gpr<->mask sequences the same between integer and fp. Meaning we only have to fix them once.

I'll post a clang patch for CGBuiltin.cpp soon.


https://reviews.llvm.org/D43137

Files:
  include/llvm/IR/IntrinsicsX86.td
  lib/IR/AutoUpgrade.cpp
  lib/Target/X86/X86ISelLowering.cpp
  test/CodeGen/X86/avx512-cmp-kor-sequence.ll
  test/CodeGen/X86/avx512vl-vec-masked-cmp.ll
  test/Transforms/InstCombine/X86/X86FsubCmpCombine.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D43137.133662.patch
Type: text/x-patch
Size: 31982 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180209/0f297e1c/attachment.bin>


More information about the llvm-commits mailing list