This is an archive of the discontinued LLVM Phabricator instance.

[DAG] Fold multiple insert_vector_elt of zero values into an AND mask
ClosedPublic

Authored by RKSimon on Mar 13 2023, 7:24 AM.

Details

Summary

This also allows us to make use of the existing isVectorClearMaskLegal shuffle canonicalization

Diff Detail

Event Timeline

RKSimon created this revision.Mar 13 2023, 7:24 AM
RKSimon requested review of this revision.Mar 13 2023, 7:24 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 13 2023, 7:24 AM
pengfei added inline comments.Mar 13 2023, 7:48 AM
llvm/test/CodeGen/X86/clear_upper_vector_element_bits.ll
722

Are SSE cases getting worse?

llvm/test/CodeGen/X86/insertelement-zero.ll
543–544

Remove these prefixes?

RKSimon added inline comments.Mar 13 2023, 8:00 AM
llvm/test/CodeGen/X86/clear_upper_vector_element_bits.ll
722

Yes - on SSE we have the weird case of an illegal type (32 x i8) being cast to an even more illegal type (64 x i4) - I'm looking at potential fixes.

I added these test cases years ago and they have been a pain ever since :)

It looks like this comes up from odd numbered vector elements quite a bit. The AArch64 changes all look OK.

RKSimon updated this revision to Diff 505095.Mar 14 2023, 7:42 AM

rebase + address feedback

pengfei accepted this revision.Mar 14 2023, 8:28 PM

LGTM.

This revision is now accepted and ready to land.Mar 14 2023, 8:28 PM
This revision was landed with ongoing or failed builds.Mar 15 2023, 2:56 AM
This revision was automatically updated to reflect the committed changes.