[PATCH] D83602: [DAGCombiner] Scalarize splats with just one demanded lane

Thomas Lively via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Jul 11 22:11:09 PDT 2020


tlively added a comment.

In D83602#2145785 <https://reviews.llvm.org/D83602#2145785>, @lebedev.ri wrote:

> Is this supposed to fix some lowering-produced code?
>  If not, shouldn't this be best done in the middle-end?


Yes, this fixes lowering-produced code. In particular, WebAssembly's vector shift instructions take a scalar shift amount, but in LLVM IR vector shifts take vector shift amounts. WebAssembly's lowering then needs to scalarize the shift entirely except when the shift amount is a splat value, in which case it can just take one lane as the scalar shift amount. This sequence of patches improves codegen in that case.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D83602/new/

https://reviews.llvm.org/D83602





More information about the llvm-commits mailing list