This is an archive of the discontinued LLVM Phabricator instance.

[AArch64][SME] Fix broken intrinsics for ZA STR (vector)
Needs RevisionPublic

Authored by sdesmalen on Mar 29 2023, 3:53 AM.

Details

Summary

Avoid generating instructions like this:

str za[w12, 0], [x0, #15, mul vl]

Because the index into ZA and the immediate of the addressing mode
should match up, e.g.

str za[w12, 15], [x0, #15, mul vl]

Diff Detail

Event Timeline

sdesmalen created this revision.Mar 29 2023, 3:53 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 29 2023, 3:53 AM
sdesmalen requested review of this revision.Mar 29 2023, 3:53 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 29 2023, 3:53 AM
david-arm accepted this revision.Mar 29 2023, 6:44 AM

LGTM! Thanks for this fix @sdesmalen.

This revision is now accepted and ready to land.Mar 29 2023, 6:44 AM
david-arm requested changes to this revision.Apr 3 2023, 3:41 AM
david-arm added a subscriber: rsandifo-arm.

Hi @sdesmalen, really sorry to do this, but following @rsandifo-arm's comment on D127317 I realised this patch is still incorrect because in @str_with_off_15mulvl it should really look like:

mov w12, #-15
str za[w12, 15], [x0, #15, mul vl]

sine the vector select value passed in to the intrinsic was 0. We therefore need to ensure the vector select value in str is also 0.

This revision now requires changes to proceed.Apr 3 2023, 3:41 AM

@sdesmalen for now I've decided to disable the AddedComplexity = 2 patterns (see D147433).