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 |
|---|---|---|
| .. | ||
| BUILD.gn | Loading commit data... | |
| CMakeLists.txt | Loading commit data... | |
| CPUID.cpp | Loading commit data... | |
| CPUID.hpp | Loading commit data... | |
| Coroutine.hpp | Loading commit data... | |
| Debug.cpp | Loading commit data... | |
| Debug.hpp | Loading commit data... | |
| EmulatedIntrinsics.cpp | Loading commit data... | |
| EmulatedIntrinsics.hpp | Loading commit data... | |
| ExecutableMemory.cpp | Loading commit data... | |
| ExecutableMemory.hpp | Loading commit data... | |
| LLVMJIT.cpp | Loading commit data... | |
| LLVMReactor.cpp | Loading commit data... | |
| LLVMReactor.hpp | Loading commit data... | |
| LLVMReactorDebugInfo.cpp | Loading commit data... | |
| LLVMReactorDebugInfo.hpp | Loading commit data... | |
| Nucleus.hpp | Loading commit data... | |
| OptimalIntrinsics.cpp | Loading commit data... | |
| OptimalIntrinsics.hpp | Loading commit data... | |
| Optimizer.cpp | Loading commit data... | |
| Optimizer.hpp | Loading commit data... | |
| Print.hpp | Loading commit data... | |
| Reactor.cpp | Loading commit data... | |
| Reactor.hpp | Loading commit data... | |
| ReactorBenchmarks.cpp | Loading commit data... | |
| ReactorDebugInfo.cpp | Loading commit data... | |
| ReactorDebugInfo.hpp | Loading commit data... | |
| ReactorUnitTests.cpp | Loading commit data... | |
| Routine.hpp | Loading commit data... | |
| SubzeroReactor.cpp | Loading commit data... | |
| Traits.hpp | Loading commit data... | |
| Traits.inl | Loading commit data... | |
| x86.hpp | Loading commit data... |