This is an archive of the discontinued LLVM Phabricator instance.

[SVE][CodeGen] Improve codegen for some zero-extends of masked loads
ClosedPublic

Authored by david-arm on Jul 14 2023, 2:53 AM.

Details

Summary

When doing a masked load of an illegal unpacked type and then
zero-extending to some illegal wider types we sometimes end up
with pointless 'and' instructions that are trying to zero bits
that we already know are zero. This patch fixes that by adding
more cases to performSVEAndCombine.

Diff Detail

Event Timeline

david-arm created this revision.Jul 14 2023, 2:53 AM
Herald added a project: Restricted Project. · View Herald Transcript
david-arm requested review of this revision.Jul 14 2023, 2:53 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 14 2023, 2:53 AM

I tried looking to see if we could add some logic to computeKnownBitsForTargetNode for UUNPKLO/HI, but the function never gets called for the above test cases.

kmclaughlin accepted this revision.Jul 14 2023, 8:09 AM

Thanks @david-arm, this LGTM!

This revision is now accepted and ready to land.Jul 14 2023, 8:09 AM
Matt added a subscriber: Matt.Jul 14 2023, 2:43 PM
This revision was landed with ongoing or failed builds.Jul 17 2023, 1:19 AM
This revision was automatically updated to reflect the committed changes.