mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-04-29 14:40:40 +03:00
Eliminate comparisons between GC allocations and constants. This removes some
`assert(this !is null)`s when member functions get inlined. Also tweak pass order a bit.
This commit is contained in:
parent
465f15eda0
commit
5ecdf1a70a
2 changed files with 56 additions and 29 deletions
|
@ -154,28 +154,26 @@ static void addPassesForOptLevel(PassManager& pm) {
|
|||
// opApply's, etc. where the actual function being called
|
||||
// wasn't known during the first inliner pass.
|
||||
addPass(pm, createFunctionInliningPass());
|
||||
|
||||
// Run clean-up again.
|
||||
addPass(pm, createScalarReplAggregatesPass());
|
||||
addPass(pm, createInstructionCombiningPass());
|
||||
}
|
||||
}
|
||||
|
||||
if (optimizeLevel >= 2 && !disableLangSpecificPasses) {
|
||||
if (!disableSimplifyRuntimeCalls)
|
||||
addPass(pm, createSimplifyDRuntimeCalls());
|
||||
|
||||
if (optimizeLevel >= 2) {
|
||||
if (!disableLangSpecificPasses) {
|
||||
if (!disableSimplifyRuntimeCalls)
|
||||
addPass(pm, createSimplifyDRuntimeCalls());
|
||||
|
||||
#ifdef USE_METADATA
|
||||
if (!disableGCToStack) {
|
||||
addPass(pm, createGarbageCollect2Stack());
|
||||
// Run some clean-up
|
||||
addPass(pm, createInstructionCombiningPass());
|
||||
addPass(pm, createScalarReplAggregatesPass());
|
||||
addPass(pm, createCFGSimplificationPass());
|
||||
}
|
||||
if (!disableGCToStack)
|
||||
addPass(pm, createGarbageCollect2Stack());
|
||||
#endif
|
||||
}
|
||||
// Run some clean-up passes
|
||||
addPass(pm, createInstructionCombiningPass());
|
||||
addPass(pm, createScalarReplAggregatesPass());
|
||||
addPass(pm, createCFGSimplificationPass());
|
||||
addPass(pm, createInstructionCombiningPass());
|
||||
}
|
||||
|
||||
|
||||
// -O3
|
||||
if (optimizeLevel >= 3)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue