We previously created and held a TargetMachine per JITRoutine as the routine could be created with different optimization levels, which is a property used to create the TargetMachine. However, a llvm::TargetMachine instance can consume a lot of memory and JITRoutines can accumulate in caches, causing dEQP test batches of 1000 to fail as all the system memory is exhausted on low-memory devices. Optimization level is the only varying property of each TargetMachine, so simply cache these by optimization level on the JITGlobals. Until we start using compiling with different optimization levels, this will ensure a single TargetMachine is shared across all JITRoutines. Bug: b/137524292 Change-Id: I97298708ea4ed14a81aa8026a51926f571d37148 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/34128 Kokoro-Presubmit: kokoro <noreply+kokoro@google.com> Reviewed-by:Nicolas Capens <nicolascapens@google.com> Reviewed-by:
Chris Forbes <chrisforbes@google.com> Tested-by:
Ben Clayton <bclayton@google.com>
| Name |
Last commit
|
Last update |
|---|---|---|
| .. | ||
| SubmoduleCheck/gtest | Loading commit data... | |
| Android.mk | Loading commit data... | |
| BUILD.gn | 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... | |
| DebugAndroid.cpp | Loading commit data... | |
| DebugAndroid.hpp | Loading commit data... | |
| ExecutableMemory.cpp | Loading commit data... | |
| ExecutableMemory.hpp | Loading commit data... | |
| LLVMReactor.cpp | Loading commit data... | |
| LLVMReactor.hpp | Loading commit data... | |
| LLVMReactorDebugInfo.cpp | Loading commit data... | |
| LLVMReactorDebugInfo.hpp | Loading commit data... | |
| MutexLock.hpp | Loading commit data... | |
| Nucleus.hpp | Loading commit data... | |
| Optimizer.cpp | Loading commit data... | |
| Optimizer.hpp | Loading commit data... | |
| Reactor.cpp | Loading commit data... | |
| Reactor.hpp | Loading commit data... | |
| Reactor.vcxproj | Loading commit data... | |
| Reactor.vcxproj.filters | Loading commit data... | |
| ReactorUnitTests.cpp | Loading commit data... | |
| ReactorUnitTests.vcxproj | Loading commit data... | |
| ReactorUnitTests.vcxproj.filters | Loading commit data... | |
| ReactorUnitTests.vcxproj.user | Loading commit data... | |
| Routine.cpp | Loading commit data... | |
| Routine.hpp | Loading commit data... | |
| Subzero.vcxproj | Loading commit data... | |
| Subzero.vcxproj.filters | Loading commit data... | |
| SubzeroLLVMDependencies.vcxproj | Loading commit data... | |
| SubzeroLLVMDependencies.vcxproj.filters | Loading commit data... | |
| SubzeroReactor.cpp | Loading commit data... | |
| Thread.cpp | Loading commit data... | |
| Thread.hpp | Loading commit data... | |
| Traits.hpp | Loading commit data... | |
| x86.hpp | Loading commit data... |