[PATCH] D145220: [X86][InstCombine] Simplify some `pternlog` intrinsics

Noah Goldstein via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 2 23:42:41 PST 2023


goldstein.w.n created this revision.
Herald added subscribers: pengfei, hiraditya.
Herald added a project: All.
goldstein.w.n requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Currently `pternlog` intrinsics stay as a function call and are unable
to merge with other bin-ops / constant-fold.

This commit adds support for reducing all `pternlog` intrinsics to
their base logic-ops so that they can be further reduced in other
passes.

Since the x86 backend doesn't do a great job creating `vpternlog`
instructions from stray logic ops, the current logic only simplifies
in the cases were we obviously will be able to do as good or
better. As the x86 backend improves, more cases can be simplified.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D145220

Files:
  llvm/lib/Target/X86/X86InstCombineIntrinsic.cpp
  llvm/test/CodeGen/X86/ternlog.ll
  llvm/test/Transforms/InstCombine/X86/x86-ternlog.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D145220.502064.patch
Type: text/x-patch
Size: 244640 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230303/5861a36d/attachment-0001.bin>


More information about the llvm-commits mailing list