This is an archive of the discontinued LLVM Phabricator instance.

[MIPS][MSA] Convert vector integer min/max opcodes to generic implementation
ClosedPublic

Authored by RKSimon on Feb 17 2018, 10:53 AM.

Details

Summary

I can't find any reason why we can't just use the SMIN/SMAX/UMIN/UMAX opcodes instead of the MipsISD versions.

Not sure what to do for the max_a/min_a instructions?

Found while investigating D43338

PS - the LLVM project needs more Simons.

Diff Detail

Repository
rL LLVM

Event Timeline

RKSimon created this revision.Feb 17 2018, 10:53 AM
sdardis accepted this revision.Feb 17 2018, 12:34 PM

LGTM. Thanks for the clean-up.

I've encountered a similar issue this week when following up an internal bug report/todo.

Some code archaeology shows that portions of the MIPS MSA support in LLVM use MipsISD opcodes which at the time did not have a corresponding target independent ISD opcode. Our target specific opcodes were added before the generic ISD opcodes were expanded to include SMAX & co.

The min_a & co. instructions are more specific to match, which is beyond the scope of this change, so they can be ignored.

Thanks again.
Simon

lib/Target/Mips/MipsSEISelLowering.cpp
897 ↗(On Diff #134809)

Nit: C++ operator precedence, == is higher than ||, so the brackets around the type comparison are strictly redundant, though they do help make the checks obvious. That's a tiny cleanup for the original code.

This revision is now accepted and ready to land.Feb 17 2018, 12:34 PM

PS: We should also get some more Simones as well :)

atanasyan accepted this revision.Feb 17 2018, 12:45 PM

Can't miss this review and add my LGTM

This revision was automatically updated to reflect the committed changes.