[PATCH] D83605: [SelectionDAG][WebAssembly] Recognize splat value ABS operations

Thomas Lively via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 10 18:46:24 PDT 2020


tlively created this revision.
tlively added reviewers: aheejin, dschuff, RKSimon, david-arm.
Herald added subscribers: llvm-commits, sunfish, hiraditya, jgravelle-google, sbc100.
Herald added a project: LLVM.

This patch gives SelectionDAG::isSplatValue the ability to look
through ABS nodes, which allows the combine introduced in D83602 <https://reviews.llvm.org/D83602> to
scalarize ABS operations when only a single lane is needed.

WebAssembly does not support ABS natively as a scalar operation, but
we still want it to be scalarized and expanded, so this patch also
adds a custom combine in the WebAssembly backend that scalarizes ABS
specifically when it is a splat and only one lane is needed. This is
useful when scalarizing WebAssembly shift values, which often contain
ABS operations in Halide output.

Depends on D83602 <https://reviews.llvm.org/D83602>.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D83605

Files:
  llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
  llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp
  llvm/test/CodeGen/WebAssembly/simd-shift-complex-splats.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D83605.277192.patch
Type: text/x-patch
Size: 7042 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200711/3a8cb3bd/attachment.bin>


More information about the llvm-commits mailing list