This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Add support for fixed vector floating point setcc.
ClosedPublic

Authored by craig.topper on Feb 11 2021, 6:17 PM.

Details

Summary

This is annoying because the condition code legalization belongs
to LegalizeDAG, but our custom handler runs in Legalize vector ops
which occurs earlier.

This adds some of the mask binary operations so that we can combine
multiple compares that we need for expansion.

I've also fixed up RISCVISelDAGToDAG.cpp to handle copies of masks.

This patch contains a subset of the integer setcc patch as well.
That patch is dependent on the integer binary ops patch. I'll rebase
based on what order the patches go in.

Diff Detail

Event Timeline

craig.topper created this revision.Feb 11 2021, 6:17 PM
craig.topper requested review of this revision.Feb 11 2021, 6:17 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 11 2021, 6:17 PM
Herald added a subscriber: MaskRay. · View Herald Transcript

clang-format

Looks good on the whole, just some minor comments. Shame about having to do our own CC legalization though.

llvm/lib/Target/RISCV/RISCVISelLowering.cpp
2116

I'd probably use Optional<unsigned> for this but maybe that's personal preference.

2171

I think this block could be commented, like why is SETOLT special.

llvm/lib/Target/RISCV/RISCVInstrInfoVVLPatterns.td
88

I was wondering if this warrants a SDTCisVecWithSameNumEltsAndEltVT<opidx, otheropidx, eltvt> to combine these three commonly-used constraints (SDTCisVec<1>, SDTCisSameNumEltsAs<0, 1>, SDTCVecEltisVT<0, X>) but the name alone gives me second thoughts.

craig.topper added inline comments.Feb 12 2021, 9:54 AM
llvm/lib/Target/RISCV/RISCVInstrInfoVVLPatterns.td
88

I think the tablegen backend maps the name of the class to dispatch to a function that does the type constraining.

I suspect SDTCisVec is redundant if SDTCVecEltisVT is specified.

-rebase
-Address review comments.
-Remove SDTCisVec when SDTCVecEltisVT is specified.

frasercrmck accepted this revision.Feb 15 2021, 1:39 AM

LGTM, cheers

This revision is now accepted and ready to land.Feb 15 2021, 1:39 AM