docs: remove -skip-unused from the docs, it is now on by default (close #23265) (#23303)

This commit is contained in:
alexey semenyuk 2024-12-29 18:32:55 +05:00 committed by GitHub
parent 50e3f9c7bb
commit f198e69c21
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -6933,7 +6933,6 @@ performance, memory usage, or size.
| `@[packed]` | Memory usage | Potential performance loss | | `@[packed]` | Memory usage | Potential performance loss |
| `@[minify]` | Performance, Memory usage | May break binary serialization/reflection | | `@[minify]` | Performance, Memory usage | May break binary serialization/reflection |
| `_likely_/_unlikely_` | Performance | Risk of negative performance impact | | `_likely_/_unlikely_` | Performance | Risk of negative performance impact |
| `-skip-unused` | Performance, Compile time, Size | Potential instability |
| `-fast-math` | Performance | Risk of incorrect mathematical operations results | | `-fast-math` | Performance | Risk of incorrect mathematical operations results |
| `-d no_segfault_handler` | Compile time, Size | Loss of segfault trace | | `-d no_segfault_handler` | Compile time, Size | Loss of segfault trace |
| `-cflags -march=native` | Performance | Risk of reduced CPU compatibility | | `-cflags -march=native` | Performance | Risk of reduced CPU compatibility |
@ -7059,15 +7058,6 @@ expression is highly improbable. In the JS backend, that does nothing.
- When the prediction can be wrong, as it might cause a performance penalty due to branch - When the prediction can be wrong, as it might cause a performance penalty due to branch
misprediction. misprediction.
#### `-skip-unused`
This flag tells the V compiler to omit code that is not needed in the final executable to run your
program correctly. This will remove unneeded `const` arrays allocations and unused functions
from the code in the generated executable.
This flag will be on by default in the future when its implementation will be stabilized and all
severe bugs will be found.
**When to Use** **When to Use**
- For production builds where you want to reduce the executable size and improve runtime - For production builds where you want to reduce the executable size and improve runtime
@ -7177,7 +7167,7 @@ rm -f *.profraw
rm -f default.profdata rm -f default.profdata
# Initial build with PGO instrumentation # Initial build with PGO instrumentation
v -cc clang -skip-unused -prod -cflags -fprofile-generate -o pgo_gen . v -cc clang -prod -cflags -fprofile-generate -o pgo_gen .
# Run the instrumented executable 10 times # Run the instrumented executable 10 times
for i in {1..10}; do for i in {1..10}; do
@ -7188,7 +7178,7 @@ done
llvm-profdata merge -o default.profdata *.profraw llvm-profdata merge -o default.profdata *.profraw
# Compile the optimized version using the PGO data # Compile the optimized version using the PGO data
v -cc clang -skip-unused -prod -cflags "-fprofile-use=${CUR_DIR}/default.profdata" -o optimized_program . v -cc clang -prod -cflags "-fprofile-use=${CUR_DIR}/default.profdata" -o optimized_program .
# Remove PGO data and instrumented executable # Remove PGO data and instrumented executable
rm *.profraw rm *.profraw