This is an archive of the discontinued LLVM Phabricator instance.

[Clang][Docs] Add help test to `-march` and `-mcpu` to suggest `-mcpu=help`
ClosedPublic

Authored by jhuber6 on May 22 2023, 7:05 AM.

Details

Summary

Currently there is no documentation for these flags, users might find it
confusing to know which values are permitted. This change simply adds
documentation to suggest using -mcpu=help to list the availible target
names.

Diff Detail

Event Timeline

jhuber6 created this revision.May 22 2023, 7:05 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 22 2023, 7:05 AM
jhuber6 requested review of this revision.May 22 2023, 7:05 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 22 2023, 7:05 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
aaron.ballman accepted this revision.May 22 2023, 7:37 AM

LGTM, though it's a bit jarring that -march suggests using -mcpu=help (should we ensure that -march=help works on all targets instead?)

This revision is now accepted and ready to land.May 22 2023, 7:37 AM

LGTM, though it's a bit jarring that -march suggests using -mcpu=help (should we ensure that -march=help works on all targets instead?)

Using -march=help works inadvertently because it will list the targets when given an invalid one. We could probably map the -mcpu=help handling to -march=help but I'm not entirely sure what the semantics should be there. The distinction between -march and -mcpu is still not entirely clear to me, it's just a matter of whether or not the target decided to choose one or the other.

LGTM, though it's a bit jarring that -march suggests using -mcpu=help (should we ensure that -march=help works on all targets instead?)

Using -march=help works inadvertently because it will list the targets when given an invalid one. We could probably map the -mcpu=help handling to -march=help but I'm not entirely sure what the semantics should be there. The distinction between -march and -mcpu is still not entirely clear to me, it's just a matter of whether or not the target decided to choose one or the other.

Oh, when I was trying it out, -march=help was not giving any useful information on some targets: https://godbolt.org/z/js4a64aTK -- FWIW, it's also unclear to me why and how these options differ.

This revision was landed with ongoing or failed builds.May 22 2023, 8:29 AM
This revision was automatically updated to reflect the committed changes.