[PATCH] D143037: [LoongArch] Override TargetLowering::hasAndNotCompare()

Gong LingQin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 31 17:14:37 PST 2023


gonglingqin created this revision.
gonglingqin added reviewers: xen0n, xry111, SixWeining, wangleiat, MaskRay.
Herald added a subscriber: hiraditya.
Herald added a project: All.
gonglingqin requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Override hasAndNotCompare() to use more `ANDN` instead of using `AND`
and `NOT`.
This patch enables the following transforms:
(X & Y) == Y ---> (~X & Y) == 0
(X & Y) != Y ---> (~X & Y) != 0.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D143037

Files:
  llvm/lib/Target/LoongArch/LoongArchISelLowering.cpp
  llvm/lib/Target/LoongArch/LoongArchISelLowering.h
  llvm/test/CodeGen/LoongArch/andn-icmp.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D143037.493787.patch
Type: text/x-patch
Size: 5450 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230201/b9dab386/attachment.bin>


More information about the llvm-commits mailing list