[PATCH] D131482: [RISCV] Return true in hasBitTest when Zbs is enabled and update BEXTI pattern for resulting canonicalisation

Philip Reames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 10 07:31:41 PDT 2022


reames accepted this revision.
reames added a comment.
This revision is now accepted and ready to land.

LGTM

Glancing at the pattern, I find myself wondering if we can generalize further.  You have:

  def : Pat<(seteq (and GPR:$rs1, SingleBitSetMask:$mask), 0),
            (BEXTI (XORI GPR:$rs1, -1), SingleBitSetMask:$mask)>;

Could we do something like:

  def : Pat<(and GPR:$rs1, SingleBitSetMask:$mask),
            (BEXTI GPR:$rs1, SingleBitSetMask:$mask)>;

Follow up only to be clear.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D131482/new/

https://reviews.llvm.org/D131482



More information about the llvm-commits mailing list