This is an archive of the discontinued LLVM Phabricator instance.

[SVE] Added CodeGen support for inserting an element into a predicate vector
ClosedPublic

Authored by DylanFleming-arm on Jun 22 2021, 9:42 AM.

Diff Detail

Event Timeline

DylanFleming-arm requested review of this revision.Jun 22 2021, 9:42 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 22 2021, 9:42 AM
efriedma added inline comments.Jun 22 2021, 11:06 AM
llvm/test/CodeGen/AArch64/sve-insert-element.ll
372

This looks messy, but I guess it's actually a surprisingly hard operation to implement in the general case. I guess you might be able to save an instruction or two here, but probably can't get it a lot shorter.

Could you include a couple testcases where idx and/or elt are constants, just to get an idea what that looks like?

Matt added a subscriber: Matt.Jun 22 2021, 11:14 AM

Added extra test cases for constant index/insert values

sdesmalen added inline comments.Jun 24 2021, 9:19 AM
llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
10158

nit:

VectorVT.getScalarType().getSizeInBits() < 32 ? MVT::i32 : VectorVT.getScalarType()
llvm/test/CodeGen/AArch64/sve-insert-element.ll
372

I'd expect this to be quite a rare operation in practice though, so probably not worth optimising early.

Changed logic for deciding ExtendValue's size

sdesmalen added inline comments.Jun 25 2021, 7:22 AM
llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
10158

Can you please run clang-format on this?

Corrected code formatting

This revision is now accepted and ready to land.Jun 25 2021, 8:18 AM