Clang currently uses -mcpu=?. The ? causes errors on some shells such as zsh
since it is a special character. In order for it to work on shells such as zsh,
the option must be passed in quotes or escaped. This patch adds -mcpu=help as
another alias for --print-supported-cpus. In llc, -mcpu=help an alias to
print supported cpus.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Code and description appear out of sync. (help != list) Personally, I like the help naming a lot better.
Sorry I just saw this but I am not sure this is a good idea. Why can't the user use --print-supported-cpus instead? The additional alias doesn't seem useful. If you can make GCC add this as well, it will be different.
According to https://reviews.llvm.org/D63105, I believe the reason mcpu=? and mtune=? were added was:
This option is useful but may be hard to discover. Will something like -march=? and -mtune=? make the feature more discoverable?
I would then say this option is being made available for the same reason: discoverability. Since llc uses help instead of ?, I think that this clang option is easier to discover since it exists in other parts of llvm. Additionally, it comes with the added benefit that help does not contain special characters that require escaping. Maybe we revert this patch and remove the ? and only support help?
Since llc has -mcpu=help, it seems fine to have clang -mcpu=help. I made a bad suggestion there about -mcpu=?. Perhaps I should revert de94ac9357750fdba45e09eefa8f67a650ae6a64 . This -mcpu=help patch is good.