This is an archive of the discontinued LLVM Phabricator instance.

[InstSimplify][AArch64] Eliminate vector reverse of ptrue/dupx intrinsics
AbandonedPublic

Authored by mnadeem on Aug 13 2021, 7:05 PM.

Details

Reviewers
david-arm
Summary

After D107793 reverse of a splat vector is eliminated.
Added a few more cases that should be simplified.
https://godbolt.org/z/6oc1dPdE9

Not sure if it is appropriate to do this here or better to move this to the target backend.

Diff Detail

Event Timeline

mnadeem created this revision.Aug 13 2021, 7:05 PM
mnadeem requested review of this revision.Aug 13 2021, 7:05 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 13 2021, 7:05 PM
david-arm added inline comments.Aug 16 2021, 1:48 AM
llvm/lib/Analysis/VectorUtils.cpp
417

To be honest, I'm not sure if this is the right place to be putting AArch64 specific intrinsics. Perhaps lib/Target/AArch64/SVEIntrinsicsOpt.cpp is a better location on this occasion?

paulwalker-arm added inline comments.
llvm/lib/Analysis/VectorUtils.cpp
417

Rather than SVEIntrinsicsOpts I recommend extending AArch64TTIImpl::instCombineIntrinsic() to canonicalise these idioms to normal LLVM splat operations. That way we don't need to teach existing code about target specific variants of splats.

Matt added a subscriber: Matt.Sep 1 2021, 7:55 AM
mnadeem planned changes to this revision.Sep 14 2021, 6:47 PM

dup.x is now canonicalized to IR splat so reverse shouldn't be an issue now.
Reverses of ptrue can still be optimized, will get back to it when I get time.

mnadeem abandoned this revision.Oct 18 2021, 2:38 PM