This is an archive of the discontinued LLVM Phabricator instance.

[AArch64][SME] Disable ZA LDR/STR addressing optimisations
ClosedPublic

Authored by david-arm on Apr 3 2023, 3:43 AM.

Details

Summary

Since the same encoded offset is used for both the vector
select offset and the address offset we have to spot two
patterns simulatenously in the ldr/str intrinsic inputs, i.e.

vector select = base + off
address = base + (off * VL)

whereas currently we only look for the address pattern. I
don't think this is possible in tablegen, so I suspect we'll
have to do this manually as part of lowering or as a target
DAG combine. For now, I've removed these tablegen patterns
so that we at least do the correct thing even if the code
quality isn't great.

I've also changed some of the ldr/str tests to pass in the
same vector select pattern (base + off) as the address
pattern.

Diff Detail

Event Timeline

david-arm created this revision.Apr 3 2023, 3:43 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 3 2023, 3:43 AM
david-arm requested review of this revision.Apr 3 2023, 3:43 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 3 2023, 3:43 AM
llvm/test/CodeGen/AArch64/sme-intrinsics-stores.ll
267

I am still able to compiler these tests, without any change in this one. The only change is in the str_with_off_15mulvl, because it does not use the mul vl.
Is this correct?

CarolineConcatto accepted this revision.Apr 5 2023, 5:52 AM

I believe we should push this patch soon in order to avoid wrong optmization

This revision is now accepted and ready to land.Apr 5 2023, 5:52 AM