summaryrefslogtreecommitdiff
path: root/src/jit/morph.cpp
diff options
context:
space:
mode:
authorAndy Ayers <andya@microsoft.com>2019-01-04 17:18:18 -0800
committerAndy Ayers <andya@microsoft.com>2019-01-04 17:18:18 -0800
commit4c68562cbd2f7a33bad60705db9b11e3121d40c2 (patch)
tree6652d9a31af13772f9978b0c40388651cc45cd1e /src/jit/morph.cpp
parentdf4a1854aa42c1e97874b00fe49339e216e30af9 (diff)
downloadcoreclr-4c68562cbd2f7a33bad60705db9b11e3121d40c2.tar.gz
coreclr-4c68562cbd2f7a33bad60705db9b11e3121d40c2.tar.bz2
coreclr-4c68562cbd2f7a33bad60705db9b11e3121d40c2.zip
JIT: encapsulate general checks for optimization
Add methods that answer the general question of whether or not the jit is optimizing the code it produces. Use this to replace composite checks for minopts and debug codegen (the two modes where the jit is not optimizing).
Diffstat (limited to 'src/jit/morph.cpp')
-rw-r--r--src/jit/morph.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/jit/morph.cpp b/src/jit/morph.cpp
index df95c9344b..b2cb5859cb 100644
--- a/src/jit/morph.cpp
+++ b/src/jit/morph.cpp
@@ -5055,7 +5055,7 @@ void Compiler::fgMakeOutgoingStructArgCopy(GenTreeCall* call,
//
// We can't determine that all of the time, but if there is only
// one use and the method has no loops, then this use must be the last.
- if (!(opts.compDbgCode || opts.MinOpts()))
+ if (opts.OptimizationEnabled())
{
GenTreeLclVarCommon* lcl = nullptr;
@@ -13208,7 +13208,7 @@ DONE_MORPHING_CHILDREN:
/* Try to change *(&lcl + cns) into lcl[cns] to prevent materialization of &lcl */
if (op1->gtOp.gtOp1->OperGet() == GT_ADDR && op1->gtOp.gtOp2->OperGet() == GT_CNS_INT &&
- (!(opts.MinOpts() || opts.compDbgCode)))
+ opts.OptimizationEnabled())
{
// No overflow arithmetic with pointers
noway_assert(!op1->gtOverflow());
@@ -15109,7 +15109,7 @@ bool Compiler::fgFoldConditional(BasicBlock* block)
bool result = false;
// We don't want to make any code unreachable
- if (opts.compDbgCode || opts.MinOpts())
+ if (opts.OptimizationDisabled())
{
return false;
}
@@ -15611,7 +15611,8 @@ void Compiler::fgMorphStmts(BasicBlock* block, bool* lnot, bool* loadw)
continue;
}
#ifdef FEATURE_SIMD
- if (!opts.MinOpts() && stmt->gtStmtExpr->TypeGet() == TYP_FLOAT && stmt->gtStmtExpr->OperGet() == GT_ASG)
+ if (opts.OptimizationEnabled() && stmt->gtStmtExpr->TypeGet() == TYP_FLOAT &&
+ stmt->gtStmtExpr->OperGet() == GT_ASG)
{
fgMorphCombineSIMDFieldAssignments(block, stmt);
}
@@ -15834,7 +15835,7 @@ void Compiler::fgMorphBlocks()
//
// Local assertion prop is enabled if we are optimized
//
- optLocalAssertionProp = (!opts.compDbgCode && !opts.MinOpts());
+ optLocalAssertionProp = opts.OptimizationEnabled();
if (optLocalAssertionProp)
{
@@ -16862,7 +16863,7 @@ void Compiler::fgMorph()
// TODO-ObjectStackAllocation: Enable the optimization for architectures using
// JIT32_GCENCODER (i.e., x86).
#ifndef JIT32_GCENCODER
- if (JitConfig.JitObjectStackAllocation() && !opts.MinOpts() && !opts.compDbgCode)
+ if (JitConfig.JitObjectStackAllocation() && opts.OptimizationEnabled())
{
objectAllocator.EnableObjectStackAllocation();
}