This is an archive of the discontinued LLVM Phabricator instance.

[ARM] Match MVE vqdmulh
ClosedPublic

Authored by dmgreen on Oct 24 2020, 6:44 AM.

Details

Summary

This adds ISel matching for a form of VQDMULH. There are several ir patterns that we could match to that instruction, this one is for:

min(ashr(mul(sext(a), sext(b)), 7), 127)

Which is what llvm will optimize to once it has removed the max that usually makes up the min/max saturate pattern, as in this case the compare will always be false. The additional complication to match i32 patterns (which extend into an i64) is that the min will be a vselect/setcc, as vmin is not supported for i64 vectors. Tablegen patterns have also been updated to attempt to reuse the MVE_TwoOpPattern patterns.

Diff Detail

Event Timeline

dmgreen created this revision.Oct 24 2020, 6:44 AM
dmgreen requested review of this revision.Oct 24 2020, 6:44 AM
SjoerdMeijer accepted this revision.Oct 26 2020, 1:17 AM

LGTM

llvm/lib/Target/ARM/ARMISelLowering.h
219

Nit: a comment what this is.

llvm/test/CodeGen/Thumb2/mve-vqdmulh.ll
8

Is this a new PR? Replacing 100 instructions with just 1?

This revision is now accepted and ready to land.Oct 26 2020, 1:17 AM
This revision was automatically updated to reflect the committed changes.