|Title||Optimization possibility for NOTREACHED in RASH variety|
|Assigned user||Gareth Rees|
|Description||In the RASH variety we define NOTREACHED as expanding to NOOP.|
#define NOTREACHED NOOP
Compilers would have more opportunities for optimization if we indicated that we believe this statement is not reachable.
This might also improve the accuracy of the test coverage report; see job003443.
|Analysis||Both Clang/LLVM  and GCC  have a builtin for declaring to the compiler that a statement is unreachable, so for these compilers we could use:|
#define NOTREACHED __builtin_unreachable()
RB says that there are other builtins for providing hints like "this is the more/less likely branch to take". For example, the various assertion macros could say "less likely" and that might prompt the compiler to move them out of the main line of execution.
We would want to do some measurement before deciding that any of this was worthwhile, of course.
GDR 2013-05-16: I tried this out, and it neither improves the runtime of the test suite, nor does it improve the accuracy of the coverage reporting. So I marked this job as suspended.
|Created by||Gareth Rees|
|Created on||2013-03-14 14:26:59|
|Last modified by||Gareth Rees|
|Last modified on||2013-05-16 11:47:49|
|History||2013-03-14 GDR Created.|
2013-05-16 GDR Suspended.