This is an archive of the discontinued LLVM Phabricator instance.

[AArch64][SVE] Put zeroing pseudos and patterns under flag.
ClosedPublic

Authored by sdesmalen on Jun 29 2020, 8:55 AM.

Details

Summary

This patch puts the _ZERO pseudos and corresponding patterns
under the predicate 'UseExperimentalZeroingPseudos', so that they
can be enabled/disabled through compile flags.

This is done because the zeroing pseudos use MOVPRFX to do merging of
the inactive lanes, but it depends on the uarch whether this operation
is actually merged with the destructive operation. If not, it may be
more profitable to use a SELECT and to give the compiler the freedom to
schedule these instructions as normal, rather than keeping them bundled
together. Additionally, this feature is not yet fully implemented and
there are still known bugs (see D80410) that need to be resolved before
the 'experimental' can be dropped from the name.

Diff Detail

Event Timeline

sdesmalen created this revision.Jun 29 2020, 8:55 AM
Herald added a project: Restricted Project. · View Herald Transcript
paulwalker-arm added inline comments.Jun 29 2020, 9:25 AM
llvm/lib/Target/AArch64/AArch64SVEInstrInfo.td
230

We also use these multiclasses for undef style merging. Can the predicate be pushed into the multiclass?

sdesmalen updated this revision to Diff 274723.EditedJul 1 2020, 2:14 AM
  • Rebased patch, only zeroing forms are now predicated, (false lanes undef forms are now in separate multiclass)
  • Some NFC changes while I was going through this file to clear up the meaning of things:
    • renamed _zx suffix of multiclasses to _zeroing[_bhsd]
    • Changed isOrig to isReverseInstr
  • Changed isOrig to isReverseInstr

I can see this change within SVEInstrInfo where you've reversed the flag but I don't see an equivalent change within SVEInstrFormat.td. Am I misunderstanding something?

sdesmalen updated this revision to Diff 274765.Jul 1 2020, 5:07 AM
  • Updated isReverseInstr in SVEInstrFormats.
  • Changed isOrig to isReverseInstr

I can see this change within SVEInstrInfo where you've reversed the flag but I don't see an equivalent change within SVEInstrFormat.td. Am I misunderstanding something?

I forgot to add those changes to the patch, I've added them in the latest revision.

SjoerdMeijer added inline comments.
llvm/lib/Target/AArch64/AArch64Subtarget.h
107

Drive-by nit: Armv8.2 SVE -> Arm SVE?

paulwalker-arm added inline comments.Jul 1 2020, 5:48 AM
llvm/lib/Target/AArch64/SVEInstrFormats.td
1576

I think you need to either invert isReverseInstr before passing to SVEInstr2Rev or update SVEInstr2Rev.

Perhaps it's worth deferring the isReverseInstr part of this change? It's up to you but you could just change the default value of isOrig to 1 if it's the "not having to do anything special for non-reversed instructions" part you're most interested in.

sdesmalen updated this revision to Diff 274835.Jul 1 2020, 8:57 AM
sdesmalen edited the summary of this revision. (Show Details)

Removed changes around renaming of reverse instructions (will do that in a separate patch)

paulwalker-arm added inline comments.Jul 1 2020, 1:23 PM
llvm/lib/Target/AArch64/AArch64SVEInstrInfo.td
1279–1280

(RE: isReverseInstr) It looks like you missed reverting this part of the patch.

2299–2300

Given the use of null_frag, do these entries do anything useful?

sdesmalen updated this revision to Diff 275047.Jul 2 2020, 4:07 AM
sdesmalen marked 3 inline comments as done.
  • Removed isReverseInstr straggler
  • Updated comment.
sdesmalen added inline comments.Jul 2 2020, 4:08 AM
llvm/lib/Target/AArch64/AArch64SVEInstrInfo.td
2299–2300

They don't, but their name was already used in the multiclass above, so I thought it made sense to define the Pseudos but not have them match in any patterns yet.

paulwalker-arm accepted this revision.Jul 2 2020, 4:32 AM
paulwalker-arm added inline comments.
llvm/lib/Target/AArch64/AArch64SVEInstrInfo.td
2299–2300

I guess it won't be redundant for long once the zeroing is fleshed out.

This revision is now accepted and ready to land.Jul 2 2020, 4:32 AM
This revision was automatically updated to reflect the committed changes.
Matt added a subscriber: Matt.Jan 11 2023, 3:46 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 11 2023, 3:46 PM
rkruppe removed a subscriber: rkruppe.Jan 13 2023, 9:11 AM