diff options
Diffstat (limited to 'lib/Target/JSBackend/AllocaManager.cpp')
-rw-r--r-- | lib/Target/JSBackend/AllocaManager.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/Target/JSBackend/AllocaManager.cpp b/lib/Target/JSBackend/AllocaManager.cpp index 6c4c49f0d0..4673a34644 100644 --- a/lib/Target/JSBackend/AllocaManager.cpp +++ b/lib/Target/JSBackend/AllocaManager.cpp @@ -450,7 +450,8 @@ void AllocaManager::computeFrameOffsets() { AllocaManager::AllocaManager() { } -void AllocaManager::analyze(const Function &Func, const DataLayout &Layout) { +void AllocaManager::analyze(const Function &Func, const DataLayout &Layout, + bool PerformColoring) { NamedRegionTimer Timer("AllocaManager", TimePassesIsEnabled); assert(Allocas.empty()); @@ -469,8 +470,11 @@ void AllocaManager::analyze(const Function &Func, const DataLayout &Layout) { LifetimeStart = M->getFunction(Intrinsic::getName(Intrinsic::lifetime_start)); LifetimeEnd = M->getFunction(Intrinsic::getName(Intrinsic::lifetime_end)); - if ((LifetimeStart && !LifetimeStart->use_empty()) || - (LifetimeEnd && !LifetimeEnd->use_empty())) { + // If we are optimizing and the module contains any lifetime intrinsics, run + // the alloca coloring algorithm. + if (PerformColoring && + ((LifetimeStart && !LifetimeStart->use_empty()) || + (LifetimeEnd && !LifetimeEnd->use_empty()))) { collectMarkedAllocas(); |