This is an archive of the discontinued LLVM Phabricator instance.

[VE] LEGALAVL and staged VVP legalization
ClosedPublic

Authored by simoll on Jan 26 2022, 11:36 PM.

Details

Summary

The new LEGALAVL node annotates that the AVL refers to packs of 64bit.
We use a two-stage lowering approach with LEGALAVL:

First, standard SDNodes are translated into illegal VVP layer nodes.
Regardless of source (VP or standard), all VVP nodes have a mask and AVL
parameter. The AVL parameter refers to the element position (just as in
VP intrinsics).

Second, we legalize the AVL usage in VVP layer nodes. If the element
size is < 64bit, the EVL parameter has to be adjusted to refer to packs
of 64bits. We wrap the legalized AVL in a LEGALAVL node to track this.

Diff Detail

Event Timeline

simoll created this revision.Jan 26 2022, 11:36 PM
simoll requested review of this revision.Jan 26 2022, 11:36 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 26 2022, 11:36 PM
kaz7 added a comment.Jan 30 2022, 8:17 PM

Please add more comments.

llvm/lib/Target/VE/VECustomDAG.h
30–43

It's better to have more descriptions of these AVL stuff.

llvm/lib/Target/VE/VEISelLowering.cpp
1671–1679

Why do you add these functions to VEISelLowering.cpp instead of VVPISelLowering.cpp which you implemented in local develop branch? Those cause more conflicts at merge. I appreciate if you follow what you implemented in local develop branch.

craig.topper added inline comments.
llvm/lib/Target/VE/VECustomDAG.cpp
47

Can use Optional::getValueOr?

llvm/lib/Target/VE/VEISelLowering.cpp
1696

LLVM coding standards would prefer "auto *ConstAVL" so that the pointerness isn't hidden.

simoll updated this revision to Diff 404444.Jan 31 2022, 2:00 AM
simoll marked 4 inline comments as done.

Moved VVP layer lowering and legal to VVPISelLowering

kaz7 accepted this revision.Jan 31 2022, 11:29 PM

LGTM now.

This revision is now accepted and ready to land.Jan 31 2022, 11:29 PM
This revision was landed with ongoing or failed builds.Feb 2 2022, 12:14 AM
This revision was automatically updated to reflect the committed changes.