This is an archive of the discontinued LLVM Phabricator instance.

[mips] Warn when crc, ginv, virt flags are used with too old revision
ClosedPublic

Authored by vstefanovic on Jul 2 2018, 11:05 AM.

Details

Summary

CRC and GINV ASE require revision 6, Virtualization requires revision 5.
Print a warning when revision is older than required.

Diff Detail

Repository
rL LLVM

Event Timeline

vstefanovic created this revision.Jul 2 2018, 11:05 AM
atanasyan accepted this revision.Jul 3 2018, 4:19 AM

LGTM with one minor note.

lib/Target/Mips/MipsSubtarget.cpp
202 ↗(On Diff #153758)

Looks good. But maybe the code below is a bit shorter?

StringRef ArchName = hasMips64() ? "MIPS64" : "MIPS32";

if (!hasMips32r5() && hasMSA() && !MSAWarningPrinted) {
  errs() << "warning: the 'msa' ASE requires " << ArchName
         << " revision 5 or greater\n";
  MSAWarningPrinted = true;
}
if (!hasMips32r5() && hasVirt() && !VirtWarningPrinted) {
  errs() << "warning: the 'virt' ASE requires " << ArchName
         << " revision 5 or greater\n";
  VirtWarningPrinted = true;
}
if (!hasMips32r6() && hasCRC() && !CRCWarningPrinted) {
  errs() << "warning: the 'crc' ASE requires " << ArchName
         << " revision 6 or greater\n";
  CRCWarningPrinted = true;
}
if (hasMips32r6() && hasGINV() && !GINVWarningPrinted) {
  errs() << "warning: the 'ginv' ASE requires " << ArchName
         << " revision 6 or greater\n";
  GINVWarningPrinted = true;
}
This revision is now accepted and ready to land.Jul 3 2018, 4:19 AM
vstefanovic marked an inline comment as done.Jul 4 2018, 6:16 AM
vstefanovic added inline comments.
lib/Target/Mips/MipsSubtarget.cpp
202 ↗(On Diff #153758)

Yes, this one's better, thanks.

This revision was automatically updated to reflect the committed changes.
vstefanovic marked an inline comment as done.
llvm/trunk/test/CodeGen/Mips/ase_warnings.ll