[all-commits] [llvm/llvm-project] 7d6e8f: [slp] Delete dead scalar instructions feeding vect...

Philip Reames via All-commits all-commits at lists.llvm.org
Mon Mar 28 20:10:33 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 7d6e8f2a96a228b8f30ee7fe472157c00d3a57af
      https://github.com/llvm/llvm-project/commit/7d6e8f2a96a228b8f30ee7fe472157c00d3a57af
  Author: Philip Reames <listmail at philipreames.com>
  Date:   2022-03-28 (Mon, 28 Mar 2022)

  Changed paths:
    M llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
    M llvm/test/Transforms/SLPVectorizer/AArch64/64-bit-vector.ll
    M llvm/test/Transforms/SLPVectorizer/AArch64/PR38339.ll
    M llvm/test/Transforms/SLPVectorizer/AArch64/commute.ll
    M llvm/test/Transforms/SLPVectorizer/AArch64/horizontal.ll
    M llvm/test/Transforms/SLPVectorizer/AArch64/loadi8.ll
    M llvm/test/Transforms/SLPVectorizer/AArch64/matmul.ll
    M llvm/test/Transforms/SLPVectorizer/AArch64/memory-runtime-checks.ll
    M llvm/test/Transforms/SLPVectorizer/AArch64/reorder-fmuladd-crash.ll
    M llvm/test/Transforms/SLPVectorizer/AArch64/sdiv-pow2.ll
    M llvm/test/Transforms/SLPVectorizer/AArch64/slp-and-reduction.ll
    M llvm/test/Transforms/SLPVectorizer/AArch64/slp-or-reduction.ll
    M llvm/test/Transforms/SLPVectorizer/AArch64/slp-xor-reduction.ll
    M llvm/test/Transforms/SLPVectorizer/AArch64/spillcost-di.ll
    M llvm/test/Transforms/SLPVectorizer/AArch64/spillcost-order.ll
    M llvm/test/Transforms/SLPVectorizer/AArch64/tsc-s352.ll
    M llvm/test/Transforms/SLPVectorizer/AArch64/vectorizable-selects-min-max.ll
    M llvm/test/Transforms/SLPVectorizer/AArch64/vectorizable-selects-uniform-cmps.ll
    M llvm/test/Transforms/SLPVectorizer/AArch64/widen.ll
    M llvm/test/Transforms/SLPVectorizer/NVPTX/v2f16.ll
    M llvm/test/Transforms/SLPVectorizer/RISCV/rvv-min-vector-size.ll
    M llvm/test/Transforms/SLPVectorizer/SystemZ/pr34619.ll
    M llvm/test/Transforms/SLPVectorizer/X86/PR32086.ll
    M llvm/test/Transforms/SLPVectorizer/X86/PR35628_1.ll
    M llvm/test/Transforms/SLPVectorizer/X86/addsub.ll
    M llvm/test/Transforms/SLPVectorizer/X86/align.ll
    M llvm/test/Transforms/SLPVectorizer/X86/bottom-to-top-reorder.ll
    M llvm/test/Transforms/SLPVectorizer/X86/broadcast.ll
    M llvm/test/Transforms/SLPVectorizer/X86/broadcast_long.ll
    M llvm/test/Transforms/SLPVectorizer/X86/cmp-as-alternate-ops.ll
    M llvm/test/Transforms/SLPVectorizer/X86/combined-stores-chains.ll
    M llvm/test/Transforms/SLPVectorizer/X86/consecutive-access.ll
    M llvm/test/Transforms/SLPVectorizer/X86/continue_vectorizing.ll
    M llvm/test/Transforms/SLPVectorizer/X86/control-dependence.ll
    M llvm/test/Transforms/SLPVectorizer/X86/crash_vectorizeTree.ll
    M llvm/test/Transforms/SLPVectorizer/X86/cse.ll
    M llvm/test/Transforms/SLPVectorizer/X86/diamond.ll
    M llvm/test/Transforms/SLPVectorizer/X86/diamond_broadcast.ll
    M llvm/test/Transforms/SLPVectorizer/X86/diamond_broadcast_extra_shuffle.ll
    M llvm/test/Transforms/SLPVectorizer/X86/different-vec-widths.ll
    M llvm/test/Transforms/SLPVectorizer/X86/dot-product.ll
    M llvm/test/Transforms/SLPVectorizer/X86/external_user_jumbled_load-inseltpoison.ll
    M llvm/test/Transforms/SLPVectorizer/X86/external_user_jumbled_load.ll
    M llvm/test/Transforms/SLPVectorizer/X86/extract_in_tree_user.ll
    M llvm/test/Transforms/SLPVectorizer/X86/fmaxnum.ll
    M llvm/test/Transforms/SLPVectorizer/X86/fminnum.ll
    M llvm/test/Transforms/SLPVectorizer/X86/funclet.ll
    M llvm/test/Transforms/SLPVectorizer/X86/gather-move-out-of-loop.ll
    M llvm/test/Transforms/SLPVectorizer/X86/gep.ll
    M llvm/test/Transforms/SLPVectorizer/X86/horizontal-list.ll
    M llvm/test/Transforms/SLPVectorizer/X86/horizontal-minmax.ll
    M llvm/test/Transforms/SLPVectorizer/X86/horizontal.ll
    M llvm/test/Transforms/SLPVectorizer/X86/insert-after-bundle.ll
    M llvm/test/Transforms/SLPVectorizer/X86/insert-shuffle.ll
    M llvm/test/Transforms/SLPVectorizer/X86/insertvalue.ll
    M llvm/test/Transforms/SLPVectorizer/X86/inst_size_bug.ll
    M llvm/test/Transforms/SLPVectorizer/X86/intrinsic_with_scalar_param.ll
    M llvm/test/Transforms/SLPVectorizer/X86/jumbled-load-shuffle-placement.ll
    M llvm/test/Transforms/SLPVectorizer/X86/jumbled-load-used-in-phi.ll
    M llvm/test/Transforms/SLPVectorizer/X86/jumbled-load.ll
    M llvm/test/Transforms/SLPVectorizer/X86/jumbled_store_crash.ll
    M llvm/test/Transforms/SLPVectorizer/X86/load-merge-inseltpoison.ll
    M llvm/test/Transforms/SLPVectorizer/X86/load-merge.ll
    M llvm/test/Transforms/SLPVectorizer/X86/lookahead.ll
    M llvm/test/Transforms/SLPVectorizer/X86/loopinvariant.ll
    M llvm/test/Transforms/SLPVectorizer/X86/memory-runtime-checks.ll
    M llvm/test/Transforms/SLPVectorizer/X86/opaque-ptr.ll
    M llvm/test/Transforms/SLPVectorizer/X86/powof2div.ll
    M llvm/test/Transforms/SLPVectorizer/X86/powof2mul.ll
    M llvm/test/Transforms/SLPVectorizer/X86/pr19657.ll
    M llvm/test/Transforms/SLPVectorizer/X86/pr23510.ll
    M llvm/test/Transforms/SLPVectorizer/X86/pr27163.ll
    M llvm/test/Transforms/SLPVectorizer/X86/pr35497.ll
    M llvm/test/Transforms/SLPVectorizer/X86/pr42022-inseltpoison.ll
    M llvm/test/Transforms/SLPVectorizer/X86/pr42022.ll
    M llvm/test/Transforms/SLPVectorizer/X86/pr44067-inseltpoison.ll
    M llvm/test/Transforms/SLPVectorizer/X86/pr44067.ll
    M llvm/test/Transforms/SLPVectorizer/X86/propagate_ir_flags.ll
    M llvm/test/Transforms/SLPVectorizer/X86/reduction_loads.ll
    M llvm/test/Transforms/SLPVectorizer/X86/reduction_unrolled.ll
    M llvm/test/Transforms/SLPVectorizer/X86/remark_extract_broadcast.ll
    M llvm/test/Transforms/SLPVectorizer/X86/remark_horcost.ll
    M llvm/test/Transforms/SLPVectorizer/X86/reorder_diamond_match.ll
    M llvm/test/Transforms/SLPVectorizer/X86/resched.ll
    M llvm/test/Transforms/SLPVectorizer/X86/return.ll
    M llvm/test/Transforms/SLPVectorizer/X86/reuse-extracts-in-wider-vect.ll
    M llvm/test/Transforms/SLPVectorizer/X86/revectorized_rdx_crash.ll
    M llvm/test/Transforms/SLPVectorizer/X86/schedule_budget.ll
    M llvm/test/Transforms/SLPVectorizer/X86/scheduling.ll
    M llvm/test/Transforms/SLPVectorizer/X86/sext-inseltpoison.ll
    M llvm/test/Transforms/SLPVectorizer/X86/sext.ll
    M llvm/test/Transforms/SLPVectorizer/X86/shrink_after_reorder.ll
    M llvm/test/Transforms/SLPVectorizer/X86/shrink_after_reorder2.ll
    M llvm/test/Transforms/SLPVectorizer/X86/split-load8_2-unord.ll
    M llvm/test/Transforms/SLPVectorizer/X86/stacksave-dependence.ll
    M llvm/test/Transforms/SLPVectorizer/X86/store-jumbled.ll
    M llvm/test/Transforms/SLPVectorizer/X86/stores-non-ordered.ll
    M llvm/test/Transforms/SLPVectorizer/X86/stores_vectorize.ll
    M llvm/test/Transforms/SLPVectorizer/X86/supernode.ll
    M llvm/test/Transforms/SLPVectorizer/X86/tiny-tree.ll
    M llvm/test/Transforms/SLPVectorizer/X86/undef_vect.ll
    M llvm/test/Transforms/SLPVectorizer/X86/unreachable.ll
    M llvm/test/Transforms/SLPVectorizer/X86/vect_copyable_in_binops.ll
    M llvm/test/Transforms/SLPVectorizer/X86/vectorize-cmps.ll
    M llvm/test/Transforms/SLPVectorizer/X86/vectorize-reorder-alt-shuffle.ll
    M llvm/test/Transforms/SLPVectorizer/X86/vectorize-reorder-reuse.ll
    M llvm/test/Transforms/SLPVectorizer/X86/vectorize-reordered-list.ll
    M llvm/test/Transforms/SLPVectorizer/X86/zext-inseltpoison.ll
    M llvm/test/Transforms/SLPVectorizer/X86/zext.ll
    M llvm/test/Transforms/SLPVectorizer/int_sideeffect.ll

  Log Message:
  -----------
  [slp] Delete dead scalar instructions feeding vectorized instructions

If we vectorize a e.g. store, we leave around a bunch of getelementptrs for the individual scalar stores which we removed. We can go ahead and delete them as well.

This is purely for test output quality and readability. It should have no effect in any sane pipeline.

Differential Revision: https://reviews.llvm.org/D122493


  Commit: 33deaa13b854f6269a56b9f160c3bc3ac5f9f773
      https://github.com/llvm/llvm-project/commit/33deaa13b854f6269a56b9f160c3bc3ac5f9f773
  Author: Philip Reames <listmail at philipreames.com>
  Date:   2022-03-28 (Mon, 28 Mar 2022)

  Changed paths:
    M llvm/lib/Transforms/Scalar/MemCpyOptimizer.cpp

  Log Message:
  -----------
  [memcpyopt] Common code into performCallSlotOptzn [NFC]

We have the same code repeated in both callers, sink it into callee.

The motivation here isn't just code style, we can also defer the relatively expensive aliasing checks until the cheap structural preconditions have been validated.  (e.g. Don't bother aliasing if src is not an alloca.)  This helps compile time significantly.


Compare: https://github.com/llvm/llvm-project/compare/0217d1178b9f...33deaa13b854


More information about the All-commits mailing list