about summary refs log tree commit diff
path: root/src/doc/rustc
diff options
context:
space:
mode:
authorMingye Wang <arthur200126@gmail.com>2020-09-17 17:39:26 +0800
committerMingye Wang <arthur2e5@aosc.io>2020-10-05 07:50:44 +0800
commita35a93f09cc111a53d00efc567ad678583dd5ac7 (patch)
tree943360a4a63ea2f050f5e53e691afb5c8a11d2bc /src/doc/rustc
parent285fc7d704fcdd7b2a37d475d04d5d955490e000 (diff)
downloadrust-a35a93f09cc111a53d00efc567ad678583dd5ac7.tar.gz
rust-a35a93f09cc111a53d00efc567ad678583dd5ac7.zip
Pass tune-cpu to LLVM
I think this is how it should work...
Diffstat (limited to 'src/doc/rustc')
-rw-r--r--src/doc/rustc/src/codegen-options/index.md20
1 files changed, 18 insertions, 2 deletions
diff --git a/src/doc/rustc/src/codegen-options/index.md b/src/doc/rustc/src/codegen-options/index.md
index bed10ca16d3..f6493e49c3c 100644
--- a/src/doc/rustc/src/codegen-options/index.md
+++ b/src/doc/rustc/src/codegen-options/index.md
@@ -497,8 +497,10 @@ point instructions in software. It takes one of the following values:
 This instructs `rustc` to generate code specifically for a particular processor.
 
 You can run `rustc --print target-cpus` to see the valid options to pass
-here. Additionally, `native` can be passed to use the processor of the host
-machine. Each target has a default base CPU.
+here. Each target has a default base CPU. Special values include:
+
+* `native` can be passed to use the processor of the host machine. 
+* `generic` refers to an LLVM target with minimal features but modern tuning.
 
 ## target-feature
 
@@ -530,6 +532,20 @@ This also supports the feature `+crt-static` and `-crt-static` to control
 Each target and [`target-cpu`](#target-cpu) has a default set of enabled
 features.
 
+## tune-cpu
+
+This instructs `rustc` to schedule code specifically for a particular
+processor. This does not affect the compatibility (instruction sets or ABI),
+but should make your code slightly more efficient on the selected CPU.
+
+The valid options are the same as those for [`target-cpu`](#target-cpu).
+The default is `None`, which LLVM translates as the `target-cpu`.
+
+This is an unstable option. Use `-Z tune-cpu=machine` to specify a value.
+
+Due to limitations in LLVM (12.0.0-git9218f92), this option is currently
+effective only for x86 targets.
+
 [option-emit]: ../command-line-arguments.md#option-emit
 [option-o-optimize]: ../command-line-arguments.md#option-o-optimize
 [profile-guided optimization]: ../profile-guided-optimization.md