[PATCH] D138883: [PowerPC] find and reuse ConstantSplatVector to combine constant store into extract and store

Ting Wang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 10 20:23:21 PDT 2023


tingwang added a comment.

Hi @nemanjai, appreciate your time looking into this patch. Thank you!

I agree with you, and I think walking the chain is burning CPU cycles without achieving anything. I realized it is difficult for me to take both targets (the original memset case, and the one @lkail mentioned) in this patch, so I would like to drop the second target, in order to focus on the first one.

I like the idea to use unaligned store, and quickly tested that to see if any potential issue. Created memset.c with multiple `memset(p, 0xXY, 24);` lines to stress the performance. According to my numbers from Power10, use extract-and-store (https://reviews.llvm.org/D138883?id=493461) got 17% faster than baseline, whereas unaligned store got about 30% slower than baseline.

>From performance perspective, I think I should pursuit the original approach. However since `canCombineStoreAndExtract` target hook has been proved not beneficial (https://reviews.llvm.org/D146602) on PPC, I probably need to create one for PPC only at this moment.

Let me know if any comments. I will post patch shortly.

F28197804: memset.c <https://reviews.llvm.org/F28197804>


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