[PATCH] D138883: [SelectionDAG][PowerPC] Memset reuse vector element for tail store

Ting Wang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 30 20:17:19 PST 2022


tingwang added a comment.

In D138883#3962255 <https://reviews.llvm.org/D138883#3962255>, @lkail wrote:

> I would expect not only `memset`, some consecutive stores could also reuse the result of vector split, see https://godbolt.org/z/77aMvncb4.
> For
>
>   void foo(long a[3]) {
>       a[0] = 12;
>       a[1] = 12;
>       a[2] = 12;
>   }
>   
>   foo(long*):                               # @foo(long*)
>           .quad   .Lfunc_begin0
>           .quad   .TOC. at tocbase
>           .quad   0
>   .Lfunc_begin0:
>           xxlxor 0, 0, 0
>           li 4, 12
>           xxsplti32dx 0, 1, 12
>           std 4, 16(3)
>           stxv 0, 0(3)
>           blr
>           .long   0
>           .quad   0
>
> We don't reuse the result of `xxsplti32dx`.

Sure. The posted IR could be handled by `DAGCombiner::mergeConsecutiveStores()`, and I agree similar combine can be applied there.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D138883



More information about the llvm-commits mailing list