未验证 提交 4e6a7193 编写于 作者: B Bruce Forstall 提交者: GitHub

Remove CSE ifdefs (#51043)

* Remove CSE ifdefs

`FEATURE_ANYCSE` and `FEATURE_VALNUM_CSE` are always enabled, and
are expected to remain so, so remove the ifdefs.

* Formatting
上级 81e867ea
......@@ -2666,12 +2666,10 @@ GenTree* Compiler::optConstantAssertionProp(AssertionDsc* curAssertion,
{
const unsigned lclNum = tree->GetLclNum();
#if FEATURE_ANYCSE
if (lclNumIsCSE(lclNum))
{
return nullptr;
}
#endif
GenTree* newTree = tree;
......@@ -5167,13 +5165,11 @@ Compiler::fgWalkResult Compiler::optVNConstantPropCurStmt(BasicBlock* block, Sta
{
return WALK_CONTINUE;
}
#if FEATURE_ANYCSE
// Let's not conflict with CSE (to save the movw/movt).
if (lclNumIsCSE(tree->AsLclVarCommon()->GetLclNum()))
{
return WALK_CONTINUE;
}
#endif
break;
default:
......
......@@ -5027,11 +5027,9 @@ void Compiler::compCompile(void** methodCodePtr, uint32_t* methodCodeSize, JitFl
DoPhase(this, PHASE_OPTIMIZE_BRANCHES, &Compiler::optRedundantBranches);
}
#if FEATURE_ANYCSE
// Remove common sub-expressions
//
DoPhase(this, PHASE_OPTIMIZE_VALNUM_CSES, &Compiler::optOptimizeCSEs);
#endif // FEATURE_ANYCSE
#if ASSERTION_PROP
if (doAssertionProp)
......@@ -5997,11 +5995,7 @@ void Compiler::compCompileFinish()
else
{
printf(" %3d |", optAssertionCount);
#if FEATURE_ANYCSE
printf(" %3d |", optCSEcount);
#else
printf(" %3d |", 0);
#endif // FEATURE_ANYCSE
}
if (info.compPerfScore < 9999.995)
......
......@@ -78,9 +78,7 @@ struct InitVarDscInfo; // defined in register_arg_convention.h
class FgStack; // defined in fgbasic.cpp
class Instrumentor; // defined in fgprofile.cpp
class SpanningTreeVisitor; // defined in fgprofile.cpp
#if FEATURE_ANYCSE
class CSE_DataFlow; // defined in OptCSE.cpp
#endif
#ifdef DEBUG
struct IndentStack;
#endif
......@@ -6580,8 +6578,6 @@ protected:
bool optAvoidIncDec(BasicBlock::weight_t bbWeight);
bool optAvoidIntMult(void);
#if FEATURE_ANYCSE
protected:
// The following is the upper limit on how many expressions we'll keep track
// of for the CSE analysis.
......@@ -6741,9 +6737,6 @@ protected:
return (enckey & ~TARGET_SIGN_BIT) << CSE_CONST_SHARED_LOW_BITS;
}
#endif // FEATURE_ANYCSE
#if FEATURE_VALNUM_CSE
/**************************************************************************
* Value Number based CSEs
*************************************************************************/
......@@ -6760,9 +6753,6 @@ protected:
void optValnumCSE_Availablity();
void optValnumCSE_Heuristic();
#endif // FEATURE_VALNUM_CSE
#if FEATURE_ANYCSE
bool optDoCSE; // True when we have found a duplicate CSE tree
bool optValnumCSE_phase; // True when we are executing the optValnumCSE_phase
unsigned optCSECandidateTotal; // Grand total of CSE candidates for both Lexical and ValNum
......@@ -6793,8 +6783,6 @@ protected:
#endif
void optOptimizeCSEs();
#endif // FEATURE_ANYCSE
struct isVarAssgDsc
{
GenTree* ivaSkip;
......
......@@ -902,9 +902,7 @@ inline GenTree::GenTree(genTreeOps oper, var_types type DEBUGARG(bool largeNode)
#ifdef DEBUG
gtDebugFlags = 0;
#endif // DEBUG
#if FEATURE_ANYCSE
gtCSEnum = NO_CSE;
#endif // FEATURE_ANYCSE
#if ASSERTION_PROP
ClearAssertion();
#endif
......
......@@ -72,16 +72,10 @@ CompPhaseNameMacro(PHASE_BUILD_SSA_LIVENESS, "SSA: liveness",
CompPhaseNameMacro(PHASE_BUILD_SSA_DF, "SSA: DF", "SSA-DF", false, PHASE_BUILD_SSA, false)
CompPhaseNameMacro(PHASE_BUILD_SSA_INSERT_PHIS, "SSA: insert phis", "SSA-PHI", false, PHASE_BUILD_SSA, false)
CompPhaseNameMacro(PHASE_BUILD_SSA_RENAME, "SSA: rename", "SSA-REN", false, PHASE_BUILD_SSA, false)
CompPhaseNameMacro(PHASE_EARLY_PROP, "Early Value Propagation", "ERL-PROP", false, -1, false)
CompPhaseNameMacro(PHASE_VALUE_NUMBER, "Do value numbering", "VAL-NUM", false, -1, false)
CompPhaseNameMacro(PHASE_OPTIMIZE_INDEX_CHECKS, "Optimize index checks", "OPT-CHK", false, -1, false)
#if FEATURE_VALNUM_CSE
CompPhaseNameMacro(PHASE_OPTIMIZE_VALNUM_CSES, "Optimize Valnum CSEs", "OPT-CSE", false, -1, false)
#endif
CompPhaseNameMacro(PHASE_VN_COPY_PROP, "VN based copy prop", "CP-PROP", false, -1, false)
CompPhaseNameMacro(PHASE_OPTIMIZE_BRANCHES, "Redundant branch opts", "OPT-BR", false, -1, false)
#if ASSERTION_PROP
......
......@@ -10805,7 +10805,6 @@ void Compiler::gtGetLclVarNameInfo(unsigned lclNum, const char** ilKindOut, cons
}
else if (ilNum == (unsigned)ICorDebugInfo::UNKNOWN_ILNUM)
{
#if FEATURE_ANYCSE
if (lclNumIsTrueCSE(lclNum))
{
ilKind = "cse";
......@@ -10819,7 +10818,6 @@ void Compiler::gtGetLclVarNameInfo(unsigned lclNum, const char** ilKindOut, cons
ilNum = lclNum - (optCSEstart + optCSEcount);
}
else
#endif // FEATURE_ANYCSE
{
if (lclNum == info.compLvFrameListRoot)
{
......
......@@ -414,8 +414,6 @@ struct GenTree
genTreeOps gtOperSave; // Only used to save gtOper when we destroy a node, to aid debugging.
#endif
#if FEATURE_ANYCSE
#define NO_CSE (0)
#define IS_CSE_INDEX(x) ((x) != 0)
......@@ -427,8 +425,6 @@ struct GenTree
signed char gtCSEnum; // 0 or the CSE index (negated if def)
// valid only for CSE expressions
#endif // FEATURE_ANYCSE
unsigned char gtLIRFlags; // Used for nodes that are in LIR. See LIR::Flags in lir.h for the various flags.
#if ASSERTION_PROP
......
......@@ -406,11 +406,6 @@ public:
/*****************************************************************************/
#define FEATURE_VALNUM_CSE 1 // enable the Value Number CSE optimization logic
// true if Value Number CSE is enabled
#define FEATURE_ANYCSE FEATURE_VALNUM_CSE
#define CSE_INTO_HANDLERS 0
#define LARGE_EXPSET 1 // Track 64 or 32 assertions/copies/consts/rangechecks
......
......@@ -13628,14 +13628,12 @@ DONE_MORPHING_CHILDREN:
goto SKIP;
}
#if FEATURE_ANYCSE
/* If the LCL_VAR is a CSE temp then bail, it could have multiple defs/uses */
// Fix 383856 X86/ARM ILGEN
if (lclNumIsCSE(lclNum))
{
goto SKIP;
}
#endif
/* We also must be assigning the result of a RELOP */
if (asg->AsOp()->gtOp1->gtOper != GT_LCL_VAR)
......
......@@ -16,10 +16,6 @@ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#pragma hdrstop
#endif
/*****************************************************************************/
#if FEATURE_ANYCSE
/*****************************************************************************/
/* static */
const size_t Compiler::s_optCSEhashSizeInitial = EXPSET_SZ * 2;
const size_t Compiler::s_optCSEhashGrowthFactor = 2;
......@@ -338,10 +334,6 @@ bool Compiler::optCSEcostCmpSz::operator()(const CSEdsc* dsc1, const CSEdsc* dsc
return dsc1->csdIndex < dsc2->csdIndex;
}
/*****************************************************************************/
#if FEATURE_VALNUM_CSE
/*****************************************************************************/
/*****************************************************************************
*
* Initialize the Value Number CSE tracking logic.
......@@ -3471,8 +3463,6 @@ void Compiler::optOptimizeValnumCSEs()
optValnumCSE_phase = false;
}
#endif // FEATURE_VALNUM_CSE
/*****************************************************************************
*
* The following determines whether the given expression is a worthy CSE
......@@ -3829,11 +3819,9 @@ void Compiler::optOptimizeCSEs()
optCSECandidateCount = 0;
optCSEstart = lvaCount;
#if FEATURE_VALNUM_CSE
INDEBUG(optEnsureClearCSEInfo());
optOptimizeValnumCSEs();
EndPhase(PHASE_OPTIMIZE_VALNUM_CSES);
#endif // FEATURE_VALNUM_CSE
}
/*****************************************************************************
......@@ -3888,7 +3876,3 @@ void Compiler::optEnsureClearCSEInfo()
}
#endif // DEBUG
/*****************************************************************************/
#endif // FEATURE_ANYCSE
/*****************************************************************************/
......@@ -38,11 +38,9 @@ void Compiler::optInit()
optNativeCallCount = 0;
optAssertionCount = 0;
optAssertionDep = nullptr;
#if FEATURE_ANYCSE
optCSECandidateTotal = 0;
optCSEstart = UINT_MAX;
optCSEcount = 0;
#endif // FEATURE_ANYCSE
}
DataFlow::DataFlow(Compiler* pCompiler) : m_pCompiler(pCompiler)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册