This is an archive of the discontinued LLVM Phabricator instance.

[AArch64][SVE] Fix incorrect mask type when lowering fixed type SVE gather/scatter
ClosedPublic

Authored by bsmith on Jul 28 2021, 3:49 AM.

Details

Summary

An incorrect mask type when lowering an SVE gather/scatter was causing
a codegen fault which manifested as the incorrect predicate size being
used for an SVE gather/scatter, (e.g.. p0.b rather than p0.d).

Fixes PR51182.

Diff Detail

Event Timeline

bsmith created this revision.Jul 28 2021, 3:49 AM
bsmith requested review of this revision.Jul 28 2021, 3:49 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 28 2021, 3:49 AM
sdesmalen added inline comments.Jul 28 2021, 5:39 AM
llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
4458

Do we need to do the same in LowerMGATHER?

bsmith added inline comments.Jul 28 2021, 8:10 AM
llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
4458

The gathers actually work correctly already, (as can be seen in test/CodeGen/AArch64/sve-fixed-length-masked-gather.ll). This was solely an issue with scatters, (they work slightly differently in this regard).

peterwaller-arm accepted this revision.Jul 28 2021, 8:42 AM

LGTM.

Note: This is a candidate for cherry-picking onto the 13 branch.

This revision is now accepted and ready to land.Jul 28 2021, 8:42 AM
bsmith updated this revision to Diff 362434.Jul 28 2021, 10:01 AM
bsmith retitled this revision from [AArch64][SVE] Fix incorrect mask type when lowering fixed type SVE scatter to [AArch64][SVE] Fix incorrect mask type when lowering fixed type SVE gather/scatter.
bsmith edited the summary of this revision. (Show Details)
  • Do equivalent fix for SVE gathers, which are actually broken.
sdesmalen accepted this revision.Jul 28 2021, 10:03 AM

Thanks for fixing @bsmith!

Matt added a subscriber: Matt.Jul 28 2021, 2:50 PM

This fixes the 2 stage build and my reproducer. Thanks again!