[PATCH] D139611: [DAGCombine] Fold Splat(bitcast(buildvector(x, ..))) to splat(x)

Dave Green via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 8 01:07:56 PST 2022


dmgreen created this revision.
dmgreen added reviewers: spatel, RKSimon, craig.topper.
Herald added subscribers: pmatos, asb, StephenFan, ecnelises, pengfei, hiraditya, kristof.beyls, jgravelle-google, sbc100, dschuff.
Herald added a project: All.
dmgreen requested review of this revision.
Herald added a subscriber: aheejin.
Herald added a project: LLVM.

This adds a fold which fixes a couple of regressions found in D138872 <https://reviews.llvm.org/D138872> (one for MVE, another for AArch64 NEON, both from intrinsic code). The backend could be caught not knowing how to simplify either `splat(bitcast(buildvector(x,..)))` or `splat(bitcast(scalar_to_vector(x)))`.  This only handles lane 0 splats, which are only valid under LE, and needs to be a little careful with the types it creates for the new buildvector.


https://reviews.llvm.org/D139611

Files:
  llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
  llvm/test/CodeGen/AArch64/arm64-dup.ll
  llvm/test/CodeGen/AArch64/arm64-neon-3vdiff.ll
  llvm/test/CodeGen/Thumb2/mve-vdup.ll
  llvm/test/CodeGen/WebAssembly/simd-shuffle-bitcast.ll
  llvm/test/CodeGen/X86/vector-shuffle-mmx.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D139611.481183.patch
Type: text/x-patch
Size: 5505 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221208/bdf73e59/attachment.bin>


More information about the llvm-commits mailing list