This is an archive of the discontinued LLVM Phabricator instance.

[ARM] Add instruction selection patterns for vmin/vmax
ClosedPublic

Authored by sbaranga on Aug 18 2015, 9:15 AM.

Details

Summary

The mid-end was generating vector smin/smax/umin/umax nodes, but
we were using vbsl to generatate the code. This adds the vmin/vmax
patterns and a test to check that we are now generating vmin/vmax
instructions.

Diff Detail

Event Timeline

sbaranga updated this revision to Diff 32419.Aug 18 2015, 9:15 AM
sbaranga retitled this revision from to [ARM] Add instruction selection patterns for vmin/vmax.
sbaranga updated this object.
sbaranga added a subscriber: llvm-commits.
rengolin accepted this revision.Aug 19 2015, 3:06 AM
rengolin added a reviewer: rengolin.

LGTM. Thanks!

This revision is now accepted and ready to land.Aug 19 2015, 3:06 AM
jmolloy requested changes to this revision.Aug 19 2015, 3:34 AM
jmolloy edited edge metadata.

This isn't the best way to do this. Instead, we should be modifying the definition of VMINs and friends to match a "smin" node instead of a "int_arm_neon_smin".

Then, we should add lowering to ARMISelLowering.cpp to map from arm_neon_vmins to ISD::SMIN. See how I did it for FMINNAN/FMINNUM as an example.

I've noticed that you've copied this mechanism from the AArch64 backend. Mea culpa - I obviously did it suboptimally there too. Either change AArch64 too as a followup or raise a PR and I'll get around to it.

Cheers,

James

This revision now requires changes to proceed.Aug 19 2015, 3:34 AM

Sorry James, I assumed it was ok. I'm ok with waiting for a proper implementation on this, and then change the AArch64 later.

sbaranga updated this revision to Diff 32533.Aug 19 2015, 5:06 AM
sbaranga edited edge metadata.

Removed patterns and modified .td definition to match generic min/max nodes
instead of intrisic ones.

Added code to lower neon intrinsic nodes to generic min/max.

Thanks, I'll just follow up on AArch64 as well after this.

-Silviu

jmolloy accepted this revision.Aug 19 2015, 5:52 AM
jmolloy edited edge metadata.

Much nicer! LGTM

This revision is now accepted and ready to land.Aug 19 2015, 5:52 AM
sbaranga closed this revision.Aug 19 2015, 7:12 AM

Thanks, r245439!