This is an archive of the discontinued LLVM Phabricator instance.

[ARM] Extend lowering for i64 reductions
ClosedPublic

Authored by dmgreen on Dec 21 2020, 2:17 AM.

Details

Summary

The lowering of a <4 x i16> or <4 x i8> vecreduce.add into an i64 would previously be expanded, due to the i64 not being legal. This patch adjusts our reduction matchers, making it produce a VADDLV(sext A to v4i32) instead.

Diff Detail

Event Timeline

dmgreen created this revision.Dec 21 2020, 2:17 AM
dmgreen requested review of this revision.Dec 21 2020, 2:17 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 21 2020, 2:17 AM
SjoerdMeijer added inline comments.Jan 4 2021, 12:58 AM
llvm/lib/Target/ARM/ARMISelLowering.cpp
14967

I guess it would be better to replace 128 with a TTI call to query the size of vector registers? I forgot which hook that is though.

dmgreen updated this revision to Diff 314353.Jan 4 2021, 3:51 AM

Updated to use is128BitVector

llvm/lib/Target/ARM/ARMISelLowering.cpp
14967

I don't know if anything here can check TTI, nothing seems to in this file. I have changed it to use is128BitVector, which seems to be more common, and moved the comment closer which explains about non-legal types. I would expect readers to understand the size of a legal vector is 128 bits in MVE.

SjoerdMeijer accepted this revision.Jan 4 2021, 3:57 AM
SjoerdMeijer added inline comments.
llvm/lib/Target/ARM/ARMISelLowering.cpp
14967

Ah yeah, forgot about that, but is128BitVector() looks a lot better anyway!

LGTM

This revision is now accepted and ready to land.Jan 4 2021, 3:57 AM
This revision was automatically updated to reflect the committed changes.