This is an archive of the discontinued LLVM Phabricator instance.

[X86] Create all-one vector(v8i32) for TESTC(X,~X) == TESTC(X,-1) if X is v8f32
ClosedPublic

Authored by yubing on Apr 18 2023, 12:11 AM.

Details

Summary

getAllOnesConstant can only take v8i32 instead of v8f32

Diff Detail

Event Timeline

yubing created this revision.Apr 18 2023, 12:11 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 18 2023, 12:11 AM
yubing requested review of this revision.Apr 18 2023, 12:11 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 18 2023, 12:12 AM

Why is this important?

llvm/test/CodeGen/X86/combine-testp-v8f32.ll
2

Can you split the test into a seperate patch (i.e test file compiled with llc before this change) so we can see the diff this patch generates?

Why is this important?

since getAllOnesConstant can only take v8i32 instead of v8f32

llvm/test/CodeGen/X86/combine-testp-v8f32.ll
2

sorry i can't. it is compfail without this diff.

goldstein.w.n added inline comments.Apr 18 2023, 12:46 AM
llvm/test/CodeGen/X86/combine-testp-v8f32.ll
10

I think you need to regenerate this. It failed when I just tested locally.

modified   llvm/test/CodeGen/X86/combine-testp-v8f32.ll
@@ -6,7 +6,6 @@ define void @test(<8 x i32> %ref.tmp.sroa.0.16.vec.expand.i.i.i.i.i.i.i) #0 pers
 ; AVX:       # %bb.0: # %entry
 ; AVX-NEXT:    vxorps %xmm1, %xmm1, %xmm1
 ; AVX-NEXT:    vcmptrueps %ymm1, %ymm1, %ymm1
-; AVX-NEXT:    vxorps %ymm1, %ymm0, %ymm1
 ; AVX-NEXT:    vtestps %ymm1, %ymm0
 ; AVX-NEXT:    vzeroupper
 ; AVX-NEXT:    retq

Why is this important?

since getAllOnesConstant can only take v8i32 instead of v8f32

Oh I see. Makes sense. Can you mention that in the summary/commit message?

yubing updated this revision to Diff 514549.Apr 18 2023, 12:53 AM

fix testcase

yubing edited the summary of this revision. (Show Details)Apr 18 2023, 12:54 AM

Why is this important?

since getAllOnesConstant can only take v8i32 instead of v8f32

Oh I see. Makes sense. Can you mention that in the summary/commit message?

thanks for comments. i've added it into summary

pengfei added inline comments.Apr 18 2023, 1:40 AM
llvm/test/CodeGen/X86/combine-testp-v8f32.ll
4

Simplify the names.

Nice catch

llvm/test/CodeGen/X86/combine-testp-v8f32.ll
4

Please can you put this in combine-testps.ll and an equivalent in combine-testpd.ll - there should be matching tests (and naming convention) with combine-ptest.ll that you can base it off.

yubing updated this revision to Diff 514589.Apr 18 2023, 3:17 AM

address Simon's comments

RKSimon accepted this revision.Apr 18 2023, 4:17 AM

LGTM - cheers

This revision is now accepted and ready to land.Apr 18 2023, 4:17 AM
This revision was landed with ongoing or failed builds.Apr 18 2023, 10:28 AM
This revision was automatically updated to reflect the committed changes.