This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Avoid save-restore target feature warning
ClosedPublic

Authored by lenary on Jul 1 2019, 7:06 AM.

Details

Summary

LLVM issues a warning if passed unknown target features. Neither I nor
@asb noticed this until after https://reviews.llvm.org/D63498 landed.

This patch stops passing the (unknown) "save-restore" target feature to
the LLVM backend, but continues to emit a warning if a driver asks for
-msave-restore. The default of assuming -mno-save-restore (and
emitting no warnings) remains.

Event Timeline

lenary created this revision.Jul 1 2019, 7:06 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 1 2019, 7:06 AM
asb accepted this revision.Jul 1 2019, 7:21 AM

LGTM, thanks.

This revision is now accepted and ready to land.Jul 1 2019, 7:21 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptJul 1 2019, 7:54 AM
jrtc27 added a comment.Dec 2 2021, 6:58 AM

For historical documentation purposes:

I don't think this ever actually fully worked. Whilst it stops passing the feature explicitly here, and thus means no target feature is passed when you don't specify either driver option, -m(no-)save-restore is still in m_riscv_Features_Group and so the later call to handleTargetFeaturesGroup still automatically adds [+-]save-restore if you specify one of the options on the command line, meaning -mno-save-restore still warned in Clang 9 and 10 despite having this patch. Clang 11 stopped warning as the feature was finally implemented by then.

https://godbolt.org/z/Gqv3GG6n4

rkruppe removed a subscriber: rkruppe.Dec 2 2021, 10:43 AM