Skip to content

Commit 269ea26

Browse files
authored
JIT: Move VN-based intrinsic expansion later (#106750)
This avoids making CFG changes before IV opts, which relies on many flowgraph related annotations. For example, this expansion will create new basic blocks with empty liveness sets that IV opts potentially could end up querying.
1 parent f677348 commit 269ea26

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/coreclr/jit/compiler.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5057,10 +5057,10 @@ void Compiler::compCompile(void** methodCodePtr, uint32_t* methodCodeSize, JitFl
50575057
doBranchOpt = doValueNum && (JitConfig.JitDoRedundantBranchOpts() != 0);
50585058
doCse = doValueNum;
50595059
doAssertionProp = doValueNum && (JitConfig.JitDoAssertionProp() != 0);
5060-
doVNBasedIntrinExpansion = doValueNum;
50615060
doRangeAnalysis = doAssertionProp && (JitConfig.JitDoRangeAnalysis() != 0);
50625061
doOptimizeIVs = doAssertionProp && (JitConfig.JitDoOptimizeIVs() != 0);
50635062
doVNBasedDeadStoreRemoval = doValueNum && (JitConfig.JitDoVNBasedDeadStoreRemoval() != 0);
5063+
doVNBasedIntrinExpansion = doValueNum;
50645064
#endif // defined(OPT_CONFIG)
50655065

50665066
if (opts.optRepeat)
@@ -5147,13 +5147,6 @@ void Compiler::compCompile(void** methodCodePtr, uint32_t* methodCodeSize, JitFl
51475147
DoPhase(this, PHASE_ASSERTION_PROP_MAIN, &Compiler::optAssertionPropMain);
51485148
}
51495149

5150-
if (doVNBasedIntrinExpansion)
5151-
{
5152-
// Expand some intrinsics based on VN data
5153-
//
5154-
DoPhase(this, PHASE_VN_BASED_INTRINSIC_EXPAND, &Compiler::fgVNBasedIntrinsicExpansion);
5155-
}
5156-
51575150
if (doRangeAnalysis)
51585151
{
51595152
// Bounds check elimination via range analysis
@@ -5175,6 +5168,13 @@ void Compiler::compCompile(void** methodCodePtr, uint32_t* methodCodeSize, JitFl
51755168
DoPhase(this, PHASE_VN_BASED_DEAD_STORE_REMOVAL, &Compiler::optVNBasedDeadStoreRemoval);
51765169
}
51775170

5171+
if (doVNBasedIntrinExpansion)
5172+
{
5173+
// Expand some intrinsics based on VN data
5174+
//
5175+
DoPhase(this, PHASE_VN_BASED_INTRINSIC_EXPAND, &Compiler::fgVNBasedIntrinsicExpansion);
5176+
}
5177+
51785178
// Conservatively mark all VNs as stale
51795179
vnStore = nullptr;
51805180

0 commit comments

Comments
 (0)