summaryrefslogtreecommitdiff
path: root/src/jit/phase.h
diff options
context:
space:
mode:
authorEugene Rozenfeld <erozen@microsoft.com>2018-10-12 17:35:28 -0700
committerGitHub <noreply@github.com>2018-10-12 17:35:28 -0700
commitcb2d6ee13fe94d3112f3ac886c8e981456351e57 (patch)
treee04618df7cb75190343e73baacabbb2222825694 /src/jit/phase.h
parentd6c35b6274a49bf83eff4e1089b8013c3741d936 (diff)
downloadcoreclr-cb2d6ee13fe94d3112f3ac886c8e981456351e57.tar.gz
coreclr-cb2d6ee13fe94d3112f3ac886c8e981456351e57.tar.bz2
coreclr-cb2d6ee13fe94d3112f3ac886c8e981456351e57.zip
Move ObjectAllocator phase to run right after inlining. (#20377)
This change will support object stack allocation for the following reasons: 1. Objects should be allocated on the stack before struct promotion phase so that their fields have a chance to be promoted. 2. Eventually object stack allocation will be performed in the same phase as inlining since inlining heuristics will need to be aware of object stack allocation opportunities. I verified no x64 diffs with jit-diffs --frameworks --tests --pmi
Diffstat (limited to 'src/jit/phase.h')
-rw-r--r--src/jit/phase.h13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/jit/phase.h b/src/jit/phase.h
index d8e2940089..2077f94dd8 100644
--- a/src/jit/phase.h
+++ b/src/jit/phase.h
@@ -12,7 +12,8 @@ public:
virtual void Run();
protected:
- Phase(Compiler* _comp, const char* _name, Phases _phase = PHASE_NUMBER_OF) : comp(_comp), name(_name), phase(_phase)
+ Phase(Compiler* _comp, const char* _name, Phases _phase = PHASE_NUMBER_OF)
+ : comp(_comp), name(_name), phase(_phase), doChecks(true)
{
}
@@ -23,6 +24,7 @@ protected:
Compiler* comp;
const char* name;
Phases phase;
+ bool doChecks;
};
inline void Phase::Run()
@@ -42,7 +44,7 @@ inline void Phase::PrePhase()
comp->fgDispBasicBlocks(true);
}
- if (comp->expensiveDebugCheckLevel >= 2)
+ if (doChecks && comp->expensiveDebugCheckLevel >= 2)
{
// If everyone used the Phase class, this would duplicate the PostPhase() from the previous phase.
// But, not everyone does, so go ahead and do the check here, too.
@@ -69,8 +71,11 @@ inline void Phase::PostPhase()
}
#ifdef DEBUG
- comp->fgDebugCheckBBlist();
- comp->fgDebugCheckLinks();
+ if (doChecks)
+ {
+ comp->fgDebugCheckBBlist();
+ comp->fgDebugCheckLinks();
+ }
#endif // DEBUG
}