Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 14 additions & 5 deletions src/coreclr/jit/fgopt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1494,14 +1494,18 @@ void Compiler::fgPostImportationCleanup()

// We'll need a state variable to control the branching.
//
// It will be zero when the OSR method is entered and set to one
// It will be initialized to zero when the OSR method is entered and set to one
// once flow reaches the osrEntry.
//
unsigned const entryStateVar = lvaGrabTemp(false DEBUGARG("OSR entry state var"));
lvaTable[entryStateVar].lvType = TYP_INT;
lvaTable[entryStateVar].lvMustInit = true;
unsigned const entryStateVar = lvaGrabTemp(false DEBUGARG("OSR entry state var"));
lvaTable[entryStateVar].lvType = TYP_INT;

// Set the state variable when we reach the entry.
// Zero the entry state at method entry.
//
GenTree* const initEntryState = gtNewTempAssign(entryStateVar, gtNewZeroConNode(TYP_INT));
fgNewStmtAtBeg(fgFirstBB, initEntryState);

// Set the state variable once control flow reaches the OSR entry.
//
GenTree* const setEntryState = gtNewTempAssign(entryStateVar, gtNewOneConNode(TYP_INT));
fgNewStmtAtBeg(osrEntry, setEntryState);
Expand Down Expand Up @@ -3413,6 +3417,11 @@ bool Compiler::fgOptimizeUncondBranchToSimpleCond(BasicBlock* block, BasicBlock*
return false;
}

if (fgBBisScratch(block))
{
return false;
}

unsigned lclNum = BAD_VAR_NUM;

// First check if the successor tests a local and then branches on the result
Expand Down
2 changes: 0 additions & 2 deletions src/coreclr/vm/jitinterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -726,8 +726,6 @@ class CEEJitInfo : public CEEInfo
delete [] ((BYTE*) m_pPatchpointInfoFromJit);

m_pPatchpointInfoFromJit = NULL;
m_pPatchpointInfoFromRuntime = NULL;
m_ilOffset = 0;
#endif

#ifdef FEATURE_EH_FUNCLETS
Expand Down