This is an archive of the discontinued LLVM Phabricator instance.

[AArch64][SVE][InstCombine] last{a,b} of a splat vector
ClosedPublic

Authored by mnadeem on Jul 6 2021, 6:26 PM.

Details

Summary

Replace last{a,b}(splat(X)) with X, irrespective of the predicate.

Diff Detail

Event Timeline

mnadeem created this revision.Jul 6 2021, 6:26 PM
mnadeem requested review of this revision.Jul 6 2021, 6:26 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 6 2021, 6:26 PM
sdesmalen accepted this revision.Jul 7 2021, 12:13 AM
sdesmalen added a subscriber: sdesmalen.

This seems like a nice improvement to me, thanks!

llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp
505

The predicate is indeed irrelevant here, if all lanes of the predicate are inactive, then it would extract the first/last element.

This revision is now accepted and ready to land.Jul 7 2021, 12:13 AM

Thanks for accepting, please go ahead and merge this as I dont have commit access.

Matt added a subscriber: Matt.Jul 7 2021, 10:34 AM
This revision was automatically updated to reflect the committed changes.