[PATCH] D138734: [X86] combine-and.ll - add test coverage for scalar broadcast

Evgenii Kudriashov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 28 03:54:42 PST 2022


e-kud created this revision.
Herald added a subscriber: pengfei.
Herald added a project: All.
RKSimon added reviewers: RKSimon, pengfei.
RKSimon edited subscribers, added: llvm-commits; removed: RKSimon, pengfei.
e-kud updated this revision to Diff 478120.
e-kud added a comment.
e-kud published this revision for review.
Herald added a project: LLVM.

Added tests with bitcasts and generated assertions using the script.


RKSimon added a comment.

Please can you update this patch so its open for review? Its still flagged as a draft.



================
Comment at: llvm/test/CodeGen/X86/combine-and.ll:516
+define <8 x i16> @neg_scalar_broadcast_v8i16(i16 %a0, <8 x i16> %a1) {
+; SSE starts using a sequence of PSHUFLW and PSHUFD that is not supported.
+;
----------------
Don't edit these - just use that the SSE codegen from the update script.


================
Comment at: llvm/test/CodeGen/X86/combine-and.ll:543
+  ret <16 x i8> %4
+}
+
----------------
It would be good is to have at least one testcase where the and is behind a bitcast - since _mm_and_si128() will insert bitcasts to <2 x i64> we'll probably see this pattern:
```
define <2 x i64> @neg_scalar_broadcast_i8(i8 %a0, <2 x i64> %a1) {
  %1 = xor i8 %a0, -1
  %2 = insertelement <16 x i8> undef, i8 %1, i64 0
  %3 = shufflevector <16 x i8> %2, <16 x i8> poison, <16 x i32> zeroinitializer
  %4 = bitcast <16 x i8> %3 to <2 x i64>
  %5 = and <2 x i64> %4, %a1
  ret <2 x i64> %5
}
```


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D138734

Files:
  llvm/test/CodeGen/X86/combine-and.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D138734.478120.patch
Type: text/x-patch
Size: 7311 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221128/526f10bf/attachment.bin>


More information about the llvm-commits mailing list