Commits

Xin Tong committed 8a1dd8abc8a
Optimize how most derived type is computed in the new projection path Instead of walking the entire projection path to find the most derived type, we cache it and invalidate when the projectionpath is append'ed to. stdlib -O === Before === Running Time Self (ms) Symbol Name 25741.0ms 37.3% 0.0 swift::runSILOptimizationPasses(swift::SILModule&) 25523.0ms 37.0% 0.0 swift::SILPassManager::runOneIteration() 20654.0ms 29.9% 36.0 swift::SILPassManager::runFunctionPasses(llvm::ArrayRef<swift::SILFunctionTransform*>) 19663.0ms 28.5% 87.0 swift::SILPassManager::runPassesOnFunction(llvm::ArrayRef<swift::SILFunctionTransform*>, swift::SILFunction*) 3279.0ms 4.7% 5.0 (anonymous namespace)::SimplifyCFGPass::run() 3205.0ms 4.6% 11.0 (anonymous namespace)::ARCSequenceOpts::run() 2550.0ms 3.7% 7.0 (anonymous namespace)::SILCombine::run() 2177.0ms 3.1% 42.0 (anonymous namespace)::RedundantLoadElimination::run() 2151.0ms 3.1% 115.0 (anonymous namespace)::SILCSE::run() 1255.0ms 1.8% 18.0 (anonymous namespace)::GenericSpecializer::run() 1080.0ms 1.5% 49.0 (anonymous namespace)::DeadStoreElimination::run() 926.0ms 1.3% 189.0 (anonymous namespace)::DCE::run() 488.0ms 0.7% 3.0 (anonymous namespace)::SILCodeMotion::run() === After === Running Time Self (ms) Symbol Name 24065.0ms 36.8% 0.0 swift::runSILOptimizationPasses(swift::SILModule&) 23865.0ms 36.5% 0.0 swift::SILPassManager::runOneIteration() 19245.0ms 29.4% 42.0 swift::SILPassManager::runFunctionPasses(llvm::ArrayRef<swift::SILFunctionTransform*>) 18273.0ms 27.9% 65.0 swift::SILPassManager::runPassesOnFunction(llvm::ArrayRef<swift::SILFunctionTransform*>, swift::SILFunction*) 3096.0ms 4.7% 10.0 (anonymous namespace)::ARCSequenceOpts::run() 3081.0ms 4.7% 9.0 (anonymous namespace)::SimplifyCFGPass::run() 2381.0ms 3.6% 8.0 (anonymous namespace)::SILCombine::run() 1990.0ms 3.0% 128.0 (anonymous namespace)::SILCSE::run() 1828.0ms 2.8% 65.0 (anonymous namespace)::RedundantLoadElimination::run() 1200.0ms 1.8% 10.0 (anonymous namespace)::GenericSpecializer::run() 918.0ms 1.4% 58.0 (anonymous namespace)::DeadStoreElimination::run() 867.0ms 1.3% 140.0 (anonymous namespace)::DCE::run() 479.0ms 0.7% 11.0 (anonymous namespace)::SILCodeMotion::run() 294.0ms 0.4% 1.0 (anonymous namespace)::ConstantPropagation::run()