[PATCH] D140087: [X86] Replace (31/63 -/^ X) with (NOT X) and ignore (32/64 ^ X) when computing shift count

Noah Goldstein via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 14 20:11:51 PST 2022


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.

Shift count is masked by hardware so these peepholes just extend
common patterns for NOT to the lower bits of shift count.

As well (32/64 ^ X) is masked off by the shift so can be safely
ignored.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D140087

Files:
  llvm/lib/Target/X86/X86ISelDAGToDAG.cpp
  llvm/test/CodeGen/X86/not-shift.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D140087.483076.patch
Type: text/x-patch
Size: 24463 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221215/08660909/attachment.bin>


More information about the llvm-commits mailing list