LLVM intermediate code instrumented by MemorySanitizer can take an inordinate amount of time to compile into machine code when using the llvm::CodeGenOpt::Default optimization level. While lower optimization levels can make the generated code slower to execute, the 'None' level is just 5-20% slower, which is negligible compared to the slowdown from the instructions added by the MSan instrumentation itself. llvm::CodeGenOpt::Default: ------------------------------------------------- Benchmark Time ------------------------------------------------- ClearImage/VK_FORMAT_R8G8B8A8_UNORM 0.912 ms ClearImage/VK_FORMAT_R32_SFLOAT 3.83 ms ClearImage/VK_FORMAT_D32_SFLOAT 0.866 ms Triangle/Hello 0.996 ms Triangle/Multisample 4.63 ms llvm::CodeGenOpt::None: ------------------------------------------------- Benchmark Time ------------------------------------------------- ClearImage/VK_FORMAT_R8G8B8A8_UNORM 0.974 ms ClearImage/VK_FORMAT_R32_SFLOAT 5.42 ms ClearImage/VK_FORMAT_D32_SFLOAT 0.937 ms Triangle/Hello 1.16 ms Triangle/Multisample 4.70 ms Bug: b/173257647 Change-Id: I0d14bf1834ce23045409fa162153991cabbeac3c Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/50448 Presubmit-Ready: Nicolas Capens <nicolascapens@google.com> Reviewed-by:Antonio Maiorano <amaiorano@google.com> Tested-by:
Nicolas Capens <nicolascapens@google.com> Kokoro-Result: kokoro <noreply+kokoro@google.com>
| Name |
Last commit
|
Last update |
|---|---|---|
| .vscode | Loading commit data... | |
| build | Loading commit data... | |
| build_overrides | Loading commit data... | |
| docs | Loading commit data... | |
| extensions | Loading commit data... | |
| include | Loading commit data... | |
| src | Loading commit data... | |
| tests | Loading commit data... | |
| third_party | Loading commit data... | |
| tools/cmake_generate_graphviz | Loading commit data... | |
| .clang-format | Loading commit data... | |
| .dir-locals.el | Loading commit data... | |
| .gitignore | Loading commit data... | |
| .gitmodules | Loading commit data... | |
| AUTHORS.txt | Loading commit data... | |
| Android.bp | Loading commit data... | |
| BUILD.gn | Loading commit data... | |
| CMakeLists.txt | Loading commit data... | |
| CMakeSettings.json | Loading commit data... | |
| CONTRIBUTING.txt | Loading commit data... | |
| CONTRIBUTORS.txt | Loading commit data... | |
| LICENSE.txt | Loading commit data... | |
| OWNERS | Loading commit data... | |
| README.md | Loading commit data... | |
| codereview.settings | Loading commit data... |