[PATCH] D118644: [x86] invert a vector select IR canonicalization with a binop identity constant

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 31 12:50:31 PST 2022


spatel created this revision.
spatel added reviewers: LuoYuanke, craig.topper, xbolva00, pengfei, RKSimon.
Herald added subscribers: hiraditya, kristof.beyls, mcrosier.
spatel requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

This is an intentionally limited/different form of D90113 <https://reviews.llvm.org/D90113>. That patch bravely tries to generalize folds where we pull a binop into the arms of a select:
`N0 + (Cond ? 0 : FVal) --> Cond ? N0 : (N0 + FVal)`
...across types and targets. This is the inverse of IR canonicalization as discussed in D113442 <https://reviews.llvm.org/D113442>

I'm not sure if this is even profitable within x86, so I'm only proposing to handle x86 vector fadd/fsub as a 1st step. The intent is to prevent AVX512 regressions as mentioned in D113442 <https://reviews.llvm.org/D113442>. Please look closely at the test diffs to confirm if this is correct and better.


https://reviews.llvm.org/D118644

Files:
  llvm/lib/Target/X86/X86ISelLowering.cpp
  llvm/test/CodeGen/X86/avx512fp16-arith-intrinsics.ll
  llvm/test/CodeGen/X86/vector-bo-select.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D118644.404675.patch
Type: text/x-patch
Size: 19395 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220131/1336e1ff/attachment-0001.bin>


More information about the llvm-commits mailing list