[all-commits] [llvm/llvm-project] fd68c7: [LoongArch] Override TargetLowering::hasAndNotComp...

Gong LingQin via All-commits all-commits at lists.llvm.org
Thu Feb 2 22:27:59 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: fd68c7d223fd2d544496dd6b3b06baf6f4d8d3dc
      https://github.com/llvm/llvm-project/commit/fd68c7d223fd2d544496dd6b3b06baf6f4d8d3dc
  Author: gonglingqin <gonglingqin at loongson.cn>
  Date:   2023-02-03 (Fri, 03 Feb 2023)

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

  Log Message:
  -----------
  [LoongArch] Override TargetLowering::hasAndNotCompare()

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.

Differential Revision: https://reviews.llvm.org/D143037




More information about the All-commits mailing list