This is an archive of the discontinued LLVM Phabricator instance.

[X86] combine-and.ll - add test coverage for scalar broadcast
ClosedPublic

Authored by e-kud on Nov 25 2022, 1:05 PM.

Diff Detail

Event Timeline

e-kud created this revision.Nov 25 2022, 1:05 PM
Herald added a project: Restricted Project. · View Herald TranscriptNov 25 2022, 1:05 PM
Herald added a subscriber: pengfei. · View Herald Transcript
RKSimon added a subscriber: RKSimon.
RKSimon added inline comments.
llvm/test/CodeGen/X86/combine-and.ll
516

Don't edit these - just use that the SSE codegen from the update script.

543

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
}
RKSimon edited subscribers, added: llvm-commits; removed: RKSimon, pengfei.Nov 27 2022, 3:55 AM
e-kud updated this revision to Diff 478120.Nov 27 2022, 3:27 PM

Added tests with bitcasts and generated assertions using the script.

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

e-kud published this revision for review.Nov 28 2022, 3:54 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 28 2022, 3:54 AM

OK, I see the problem. You put them in a upside down order. You should base this patch on tip of trunk, then base D138521 on this.

e-kud updated this revision to Diff 478395.Nov 28 2022, 3:14 PM

Update tests with old codegen

pengfei accepted this revision.Nov 28 2022, 11:24 PM

LGTM.

This revision is now accepted and ready to land.Nov 28 2022, 11:24 PM
RKSimon accepted this revision.Nov 29 2022, 3:12 AM

LGTM - cheers!

This revision was landed with ongoing or failed builds.Nov 29 2022, 10:01 PM
This revision was automatically updated to reflect the committed changes.