This is an archive of the discontinued LLVM Phabricator instance.

[AArch64][SVE] Improve codegen when extracting first lane of active lane mask
ClosedPublic

Authored by RosieSumpter on May 9 2022, 2:56 AM.

Details

Summary

When extracting the first lane of a predicate created using the
llvm.get.active.lane.mask intrinsic, it should give the same codegen as
when the predicate is created using the llvm.aarch64.sve.whilelo
intrinsic, since get.active.lane.mask is lowered to whilelo. This patch
ensures the codegen is the same by recognizing
llvm.get.active.lane.mask as a flag-setting operation in this case.

Diff Detail

Event Timeline

RosieSumpter created this revision.May 9 2022, 2:56 AM
Herald added a project: Restricted Project. · View Herald Transcript
RosieSumpter requested review of this revision.May 9 2022, 2:56 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 9 2022, 2:56 AM
david-arm accepted this revision.May 9 2022, 3:56 AM

LGTM! Thanks for the codegen improvement @RosieSumpter. :)

llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
14670

nit: Could you add a short comment here explaining that get_active_lane_mask is lowered to a whilelo instruction?

This revision is now accepted and ready to land.May 9 2022, 3:56 AM
Allen accepted this revision.May 9 2022, 5:36 AM
This revision was landed with ongoing or failed builds.May 9 2022, 6:02 AM
This revision was automatically updated to reflect the committed changes.