[PATCH] D74522: [X86] Don't widen 128/256-bit strict compares with vXi1 result to 512-bits on KNL.

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 12 21:10:55 PST 2020


craig.topper created this revision.
craig.topper added reviewers: RKSimon, spatel, pengfei, andrew.w.kaylor.
Herald added a subscriber: hiraditya.
Herald added a project: LLVM.

If we widen the compare we might trigger a spurious exception from
the garbage data.

We have two choices here. Explicitly force the upper bits to zero.
Or use a legacy VEX vcmpps/pd instruction and convert the XMM/YMM
result to mask register.

I've chosen to go with the second option. I'm not sure which is
really best. In some cases we could get rid of the zeroing since
the producing instruction probably already zeroed it. But we lose
the ability to fold a load. So which is best is dependent on
surrounding code.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D74522

Files:
  llvm/lib/Target/X86/X86ISelLowering.cpp
  llvm/lib/Target/X86/X86InstrAVX512.td
  llvm/test/CodeGen/X86/vec-strict-cmp-128.ll
  llvm/test/CodeGen/X86/vec-strict-cmp-256.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D74522.244328.patch
Type: text/x-patch
Size: 157656 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200213/6f3c0357/attachment.bin>


More information about the llvm-commits mailing list