[PATCH] D149027: [X86] Add peephole to convert `(Cmp Op32/Op64, Imm8)` -> `(Cmp Op16/Op8, Imm8)`

Noah Goldstein via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Apr 23 11:30:48 PDT 2023


goldstein.w.n created this revision.
goldstein.w.n added reviewers: pengfei, RKSimon.
Herald added a subscriber: 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.

This saves a bit of codesize.

This is valid if the sign-flags are not used:

- eq : https://alive2.llvm.org/ce/z/KUtebW
- ne : https://alive2.llvm.org/ce/z/fT0hBt
- ult: https://alive2.llvm.org/ce/z/s5FEYL
- ugt: https://alive2.llvm.org/ce/z/jaq6oS
- uge: https://alive2.llvm.org/ce/z/bYzJ3p
- ule: https://alive2.llvm.org/ce/z/8QXTiC


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D149027

Files:
  llvm/lib/Target/X86/X86ISelDAGToDAG.cpp
  llvm/test/CodeGen/X86/combine-movmsk.ll
  llvm/test/CodeGen/X86/vector-reduce-and-cmp.ll
  llvm/test/CodeGen/X86/vector-reduce-and-scalar.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D149027.516193.patch
Type: text/x-patch
Size: 4509 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230423/7ee7c991/attachment.bin>


More information about the llvm-commits mailing list