[PATCH] D141653: [X86] Improve instruction ordering of constant `srl/shl` with `and` to get better and-masks

Noah Goldstein via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 12 21:34:23 PST 2023


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.

This moves some logic from `combineShiftLeft` and generalizes is to
work for `shl` and `and`. It also improves the non-mask constant
generation (reducing based on `getSignificantBits` instead of
`countTrailingOnes`) so that we can catch some cases where imm64 ->
sign-extended imm32/imm8 or imm32 -> sign-extended imm8


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D141653

Files:
  llvm/lib/Target/X86/X86ISelLowering.cpp
  llvm/lib/Target/X86/X86ISelLowering.h
  llvm/test/CodeGen/X86/avx512-calling-conv.ll
  llvm/test/CodeGen/X86/bitreverse.ll
  llvm/test/CodeGen/X86/bmi-x86_64.ll
  llvm/test/CodeGen/X86/bmi.ll
  llvm/test/CodeGen/X86/btc_bts_btr.ll
  llvm/test/CodeGen/X86/combine-bitreverse.ll
  llvm/test/CodeGen/X86/combine-rotates.ll
  llvm/test/CodeGen/X86/const-shift-of-constmasked.ll
  llvm/test/CodeGen/X86/const-shift-with-and.ll
  llvm/test/CodeGen/X86/fold-and-shift.ll
  llvm/test/CodeGen/X86/limited-prec.ll
  llvm/test/CodeGen/X86/movmsk-cmp.ll
  llvm/test/CodeGen/X86/pr15267.ll
  llvm/test/CodeGen/X86/pr26350.ll
  llvm/test/CodeGen/X86/pr32282.ll
  llvm/test/CodeGen/X86/pr45995.ll
  llvm/test/CodeGen/X86/pull-binop-through-shift.ll
  llvm/test/CodeGen/X86/rev16.ll
  llvm/test/CodeGen/X86/rotate-extract.ll
  llvm/test/CodeGen/X86/selectcc-to-shiftand.ll
  llvm/test/CodeGen/X86/setcc.ll
  llvm/test/CodeGen/X86/shift-amount-mod.ll
  llvm/test/CodeGen/X86/shift-mask.ll
  llvm/test/CodeGen/X86/sttni.ll
  llvm/test/CodeGen/X86/tbm_patterns.ll
  llvm/test/CodeGen/X86/udiv_fix.ll
  llvm/test/CodeGen/X86/udiv_fix_sat.ll
  llvm/test/CodeGen/X86/urem-seteq-illegal-types.ll
  llvm/test/CodeGen/X86/vselect.ll
  llvm/test/CodeGen/X86/zext-logicop-shift-load.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D141653.488861.patch
Type: text/x-patch
Size: 98101 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230113/1fe47eeb/attachment-0001.bin>


More information about the llvm-commits mailing list