[PATCH] D129290: [DAG] SimplifyDemandedBits - fold AND(INSERT_SUBVECTOR(C,X,I),M) -> INSERT_SUBVECTOR(AND(C,M),X,I)

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 7 06:55:56 PDT 2022


RKSimon created this revision.
RKSimon added reviewers: spatel, craig.topper, pengfei, efriedma, foad, deadalnix.
Herald added subscribers: jsji, StephenFan, hiraditya.
Herald added a project: All.
RKSimon requested review of this revision.
Herald added a project: LLVM.

If all the demanded bits of the AND mask covering the inserted subvector 'X' are known to be one, then the mask isn't affecting the subvector at all.

In which case, if the base vector 'C' is undef/constant, then move the AND mask up to just fold it directly.

Addresses some of the regressions from D129150 <https://reviews.llvm.org/D129150>, particularly the cases where we're attempting to zero the upper elements of a widened vector.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D129290

Files:
  llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
  llvm/test/CodeGen/X86/avx512-calling-conv.ll
  llvm/test/CodeGen/X86/avx512-ext.ll
  llvm/test/CodeGen/X86/avx512-mask-op.ll
  llvm/test/CodeGen/X86/min-legal-vector-width.ll
  llvm/test/CodeGen/X86/vec-strict-cmp-128-fp16.ll
  llvm/test/CodeGen/X86/vec-strict-cmp-sub128.ll
  llvm/test/CodeGen/X86/vec_smulo.ll
  llvm/test/CodeGen/X86/vec_umulo.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D129290.442893.patch
Type: text/x-patch
Size: 231210 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220707/0a0bb5b5/attachment-0001.bin>


More information about the llvm-commits mailing list