-2.1.0-preview2-02511-02
+2.1.0-preview2-02516-02
-2.1.0-preview2-26212-01
+2.1.0-preview2-26218-01
<!-- Source of truth for dependency tooling: the commit hash of the dotnet/versions master branch as of the last auto-upgrade. -->
<PropertyGroup>
- <CoreFxCurrentRef>b3eb126afa4ee4e0433c322dcd245e899ecfc60d</CoreFxCurrentRef>
- <CoreClrCurrentRef>b3eb126afa4ee4e0433c322dcd245e899ecfc60d</CoreClrCurrentRef>
- <BuildToolsCurrentRef>4f5edc2cff312f4af6e48a249c0d7b8f0f95ea30</BuildToolsCurrentRef>
- <PgoDataCurrentRef>b3eb126afa4ee4e0433c322dcd245e899ecfc60d</PgoDataCurrentRef>
+ <CoreFxCurrentRef>7657a6f8cd7c1faa71504e68a154bca8c0c4b3c3</CoreFxCurrentRef>
+ <CoreClrCurrentRef>e50641ce8a22508af923785e00f0c8e68d3d7dcc</CoreClrCurrentRef>
+ <BuildToolsCurrentRef>7657a6f8cd7c1faa71504e68a154bca8c0c4b3c3</BuildToolsCurrentRef>
+ <PgoDataCurrentRef>e50641ce8a22508af923785e00f0c8e68d3d7dcc</PgoDataCurrentRef>
</PropertyGroup>
<!-- Tests/infrastructure dependency versions. -->
<PropertyGroup>
- <MicrosoftPrivateCoreFxNETCoreAppPackageVersion>4.5.0-preview2-26212-01</MicrosoftPrivateCoreFxNETCoreAppPackageVersion>
- <MicrosoftNETCorePlatformsPackageVersion>2.1.0-preview2-26212-01</MicrosoftNETCorePlatformsPackageVersion>
- <PgoDataPackageVersion>99.99.99-master-20180212-0035</PgoDataPackageVersion>
- <MicrosoftNETCoreRuntimeCoreCLRPackageVersion>2.1.0-preview2-26212-01</MicrosoftNETCoreRuntimeCoreCLRPackageVersion>
+ <MicrosoftPrivateCoreFxNETCoreAppPackageVersion>4.5.0-preview2-26216-03</MicrosoftPrivateCoreFxNETCoreAppPackageVersion>
+ <MicrosoftNETCorePlatformsPackageVersion>2.1.0-preview2-26216-03</MicrosoftNETCorePlatformsPackageVersion>
+ <PgoDataPackageVersion>99.99.99-master-20180217-0048</PgoDataPackageVersion>
+ <MicrosoftNETCoreRuntimeCoreCLRPackageVersion>2.1.0-preview2-26218-01</MicrosoftNETCoreRuntimeCoreCLRPackageVersion>
<XunitPackageVersion>2.2.0-beta2-build3300</XunitPackageVersion>
<XunitConsoleNetcorePackageVersion>1.0.2-prerelease-00177</XunitConsoleNetcorePackageVersion>
<XunitPerformanceApiPackageVersion>1.0.0-beta-build0015</XunitPerformanceApiPackageVersion>
<!-- Package versions used as toolsets -->
<PropertyGroup>
<FeedTasksPackage>Microsoft.DotNet.Build.Tasks.Feed</FeedTasksPackage>
- <FeedTasksPackageVersion>2.1.0-preview2-02511-02</FeedTasksPackageVersion>
+ <FeedTasksPackageVersion>2.1.0-preview2-02516-02</FeedTasksPackageVersion>
</PropertyGroup>
<!-- Package dependency verification/auto-upgrade configuration. -->
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-This folder will be mirrored by the Git-TFS Mirror recursively.
\ No newline at end of file
+++ /dev/null
-This folder will be mirrored by the Git-TFS Mirror recursively.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-This folder will be mirrored by the Git-TFS Mirror recursively.
\ No newline at end of file
+++ /dev/null
-This folder will be mirrored by the Git-TFS Mirror recursively.
\ No newline at end of file
+++ /dev/null
-This folder will be mirrored by the Git-TFS Mirror recursively.
\ No newline at end of file
+++ /dev/null
-This folder will be mirrored by the Git-TFS Mirror recursively.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-This folder will be mirrored by the Git-TFS Mirror recursively.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-This folder will be mirrored by the Git-TFS Mirror recursively.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-This folder will be mirrored by the Git-TFS Mirror recursively.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-This folder will be mirrored by the Git-TFS Mirror recursively.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-This folder will be mirrored by the Git-TFS Mirror recursively.
\ No newline at end of file
+++ /dev/null
-This folder will be mirrored by the Git-TFS Mirror recursively.
\ No newline at end of file
+++ /dev/null
-This folder will be mirrored by the Git-TFS Mirror recursively.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
opts.setSupportedISA(InstructionSet_POPCNT);
}
}
- if (jitFlags.IsSet(JitFlags::JIT_FLAG_USE_SSE3))
+
+ // There are currently two sets of flags that control SSE3 through SSE4.2 support
+ // This is the general EnableSSE3_4 flag and the individual ISA flags. We need to
+ // check both for any given ISA.
+ if (JitConfig.EnableSSE3_4())
{
- if (configEnableISA(InstructionSet_SSE3))
+ if (jitFlags.IsSet(JitFlags::JIT_FLAG_USE_SSE3))
{
- opts.setSupportedISA(InstructionSet_SSE3);
+ if (configEnableISA(InstructionSet_SSE3))
+ {
+ opts.setSupportedISA(InstructionSet_SSE3);
+ }
}
- }
- if (jitFlags.IsSet(JitFlags::JIT_FLAG_USE_SSE41))
- {
- if (configEnableISA(InstructionSet_SSE41))
+ if (jitFlags.IsSet(JitFlags::JIT_FLAG_USE_SSE41))
{
- opts.setSupportedISA(InstructionSet_SSE41);
+ if (configEnableISA(InstructionSet_SSE41))
+ {
+ opts.setSupportedISA(InstructionSet_SSE41);
+ }
}
- }
- if (jitFlags.IsSet(JitFlags::JIT_FLAG_USE_SSE42))
- {
- if (configEnableISA(InstructionSet_SSE42))
+ if (jitFlags.IsSet(JitFlags::JIT_FLAG_USE_SSE42))
{
- opts.setSupportedISA(InstructionSet_SSE42);
+ if (configEnableISA(InstructionSet_SSE42))
+ {
+ opts.setSupportedISA(InstructionSet_SSE42);
+ }
}
- }
- if (jitFlags.IsSet(JitFlags::JIT_FLAG_USE_SSSE3))
- {
- if (configEnableISA(InstructionSet_SSSE3))
+ if (jitFlags.IsSet(JitFlags::JIT_FLAG_USE_SSSE3))
{
- opts.setSupportedISA(InstructionSet_SSSE3);
+ if (configEnableISA(InstructionSet_SSSE3))
+ {
+ opts.setSupportedISA(InstructionSet_SSSE3);
+ }
}
}
}
}
- opts.compCanUseSSE4 = false;
- if (!jitFlags.IsSet(JitFlags::JIT_FLAG_PREJIT) && jitFlags.IsSet(JitFlags::JIT_FLAG_USE_SSE41) &&
- jitFlags.IsSet(JitFlags::JIT_FLAG_USE_SSE42))
- {
- if (JitConfig.EnableSSE3_4() != 0)
- {
- opts.compCanUseSSE4 = true;
- }
- }
-
if (!compIsForInlining())
{
if (canUseVexEncoding())
codeGen->getEmitter()->SetContainsAVX(false);
codeGen->getEmitter()->SetContains256bitAVX(false);
}
- else if (CanUseSSE4())
+ else if (compSupports(InstructionSet_SSSE3) || compSupports(InstructionSet_SSE41) ||
+ compSupports(InstructionSet_SSE42))
{
+ // Emitter::UseSSE4 controls whether we support the 4-byte encoding for certain
+ // instructions. We need to check if either is supported independently, since
+ // it is currently possible to enable/disable them separately.
codeGen->getEmitter()->SetUseSSE4(true);
}
}
static fgWalkPreFn optHasNonCSEChild;
static fgWalkPreFn optUnmarkCSEs;
+ static fgWalkPreFn optHasCSEdefWithSideeffect;
static int __cdecl optCSEcostCmpEx(const void* op1, const void* op2);
static int __cdecl optCSEcostCmpSz(const void* op1, const void* op2);
return SIMD_AVX2_Supported;
}
- if (CanUseSSE4())
+ // SIMD_SSE4_Supported actually requires all of SSE3, SSSE3, SSE4.1, and SSE4.2
+ // to be supported. We can only enable it if all four are enabled in the compiler
+ if (compSupports(InstructionSet_SSE42) && compSupports(InstructionSet_SSE41) &&
+ compSupports(InstructionSet_SSSE3) && compSupports(InstructionSet_SSE3))
{
return SIMD_SSE4_Supported;
}
return false;
}
- // Whether SSE2 is available
+ // Whether SSE and SSE2 is available
bool canUseSSE2() const
{
#ifdef _TARGET_XARCH_
#endif
}
- // Whether SSE3, SSSE3, SSE4.1 and SSE4.2 is available
- bool CanUseSSE4() const
- {
-#ifdef _TARGET_XARCH_
- return opts.compCanUseSSE4;
-#else
- return false;
-#endif
- }
-
bool compSupports(InstructionSet isa) const
{
#if defined(_TARGET_XARCH_) || defined(_TARGET_ARM64_)
bool compUseCMOV;
#ifdef _TARGET_XARCH_
bool compCanUseSSE2; // Allow CodeGen to use "movq XMM" instructions
- bool compCanUseSSE4; // Allow CodeGen to use SSE3, SSSE3, SSE4.1 and SSE4.2 instructions
#endif // _TARGET_XARCH_
#if defined(_TARGET_XARCH_) || defined(_TARGET_ARM64_)
// False - otherwise
//
// Notes:
-// This helper is designed to be used only from allocateBusyReg().
-// The caller must have already checked for the case where 'refPosition' is a fixed ref.
+// This helper is designed to be used only from allocateBusyReg(), where:
+// - This register was *not* found when looking for a free register, and
+// - The caller must have already checked for the case where 'refPosition' is a fixed ref
+// (asserted at the beginning of this method).
//
bool LinearScan::isRegInUse(RegRecord* regRec, RefPosition* refPosition)
{
{
if (!assignedInterval->isActive)
{
- // This can only happen if we have a recentRefPosition active at this location that hasn't yet been freed
- // (Or, in the case of ARM, the other half of a double is either active or has an active recentRefPosition).
+ // This can only happen if we have a recentRefPosition active at this location that hasn't yet been freed.
CLANG_FORMAT_COMMENT_ANCHOR;
-#ifdef _TARGET_ARM_
- if (refPosition->getInterval()->registerType == TYP_DOUBLE)
+ if (isRefPositionActive(assignedInterval->recentRefPosition, refPosition->nodeLocation))
{
- if (!isRefPositionActive(assignedInterval->recentRefPosition, refPosition->nodeLocation))
+ return true;
+ }
+ else
+ {
+#ifdef _TARGET_ARM_
+ // In the case of TYP_DOUBLE, we may have the case where 'assignedInterval' is inactive,
+ // but the other half register is active. If so, it must be have an active recentRefPosition,
+ // as above.
+ if (refPosition->getInterval()->registerType == TYP_DOUBLE)
{
RegRecord* otherHalfRegRec = findAnotherHalfRegRec(regRec);
- assert(otherHalfRegRec->assignedInterval->isActive ||
- isRefPositionActive(otherHalfRegRec->assignedInterval->recentRefPosition,
- refPosition->nodeLocation));
+ if (!otherHalfRegRec->assignedInterval->isActive)
+ {
+ if (isRefPositionActive(otherHalfRegRec->assignedInterval->recentRefPosition,
+ refPosition->nodeLocation))
+ {
+ return true;
+ }
+ else
+ {
+ assert(!"Unexpected inactive assigned interval in isRegInUse");
+ return true;
+ }
+ }
}
- }
- else
+ else
#endif
- {
- assert(isRefPositionActive(assignedInterval->recentRefPosition, refPosition->nodeLocation));
+ {
+ assert(!"Unexpected inactive assigned interval in isRegInUse");
+ return true;
+ }
}
- return true;
}
RefPosition* nextAssignedRef = assignedInterval->getNextRefPosition();
}
else // optUnmarkCSE(tree) returned false
{
- // This node is a CSE def and can not be removed.
+ // This node must be a CSE def and it can not be removed.
// Instead we will add it to the 'keepList'.
assert(IS_CSE_DEF(tree->gtCSEnum));
- if (comp->gtTreeHasSideEffects(tree, GTF_PERSISTENT_SIDE_EFFECTS_IN_CSE))
+ // The prior call to optHasCSEdefWithSideeffect ensures this
+ //
+ assert(!comp->gtTreeHasSideEffects(tree, GTF_PERSISTENT_SIDE_EFFECTS_IN_CSE));
+
+#ifdef DEBUG
+ if (comp->verbose)
{
- // If the nested CSE def has persistent side effects then just abort
- // as this case is problematic.
- return WALK_ABORT;
+ printf("Preserving the CSE def #%02d at ", GET_CSE_INDEX(tree->gtCSEnum));
+ printTreeID(tree);
+ printf(" because it is nested inside a CSE use\n");
}
- else
+#endif // DEBUG
+
+ // This tree and all of its sub-trees will be kept
+ //
+ *wbKeepList = comp->gtBuildCommaList(*wbKeepList, tree);
+
+ return WALK_SKIP_SUBTREES;
+ }
+
+ return WALK_CONTINUE;
+}
+
+//------------------------------------------------------------------------
+// Compiler::optHasCSEdefWithSideeffect
+// Helper passed to Compiler::fgWalkAllTreesPre() to deternine if
+// a sub-tree has a CSE def that contains persistent side-effects.
+// Return values:
+// We will return WALK_ABORT upon encountering the case above.
+// A final return value of WALK_CONTINUE or WALK_SKIP_SUBTREES means that
+// there wasn't a CSE def with persistent side-effects.
+//
+// argument 'pTree' is a pointer to a GenTree*
+// argument 'data' contains pCallbackData which needs to be cast from void*
+// to our actual 'wbKeepList' a pointer to a GenTree*
+//
+// Any nodes visited that are in the 'keepList' are skipped
+// For visted node not in the 'keepList' we check if the node is a CSE def
+// and if it is then we check if it has persistent side-effects
+// and if so we return WALK_ABORT.
+//
+
+/* static */
+Compiler::fgWalkResult Compiler::optHasCSEdefWithSideeffect(GenTree** pTree, fgWalkData* data)
+{
+ GenTree* tree = *pTree;
+ Compiler* comp = data->compiler;
+ GenTree** wbKeepList = (GenTree**)(data->pCallbackData);
+ GenTree* keepList = nullptr;
+
+ noway_assert(wbKeepList != nullptr);
+
+ keepList = *wbKeepList;
+
+ // We may already have a side effect list that is being kept
+ //
+ if (keepList)
+ {
+ GenTree* keptTree = keepList;
+
+ while (keptTree->OperGet() == GT_COMMA)
{
-#ifdef DEBUG
- if (comp->verbose)
+ assert(keptTree->OperKind() & GTK_SMPOP);
+ GenTree* op1 = keptTree->gtOp.gtOp1;
+ GenTree* op2 = keptTree->gtGetOp2();
+
+ // For the GT_COMMA case the op1 is part of the original CSE tree
+ // that is being kept because it contains some side-effect
+ //
+ if (tree == op1)
{
- printf("Preserving the CSE def #%02d at ", GET_CSE_INDEX(tree->gtCSEnum));
- printTreeID(tree);
- printf(" because it is nested inside a CSE use\n");
+ // This tree and all of its sub trees are being kept
+ return WALK_SKIP_SUBTREES;
}
-#endif // DEBUG
- // This tree and all of its sub-trees are being kept
+ // For the GT_COMMA case, op2 is the remaining side-effects of the
+ // original CSE tree. This can again be another GT_COMMA or the
+ // final side-effect part.
//
- *wbKeepList = comp->gtBuildCommaList(*wbKeepList, tree);
-
+ keptTree = op2;
+ }
+ if (tree == keptTree)
+ {
+ // This tree and all of its sub trees are being kept
return WALK_SKIP_SUBTREES;
}
}
+ // Now 'tree' is known to be a node that is not in the 'keepList',
+ //
+ // We will check if it is a CSE def
+ //
+ if (IS_CSE_DEF(tree->gtCSEnum))
+ {
+ // This node is a CSE def
+ // If this node contains any persistent side effects then we will return WALK_ABORT.
+ //
+ if (comp->gtTreeHasSideEffects(tree, GTF_PERSISTENT_SIDE_EFFECTS_IN_CSE))
+ {
+ // This nested CSE def contains a persistent side effect
+ // We just abort now as this case is problematic.
+ //
+ return WALK_ABORT;
+ }
+ }
return WALK_CONTINUE;
}
{
assert(optValnumCSE_phase);
+ // If we have a non-empty *wbKeepList, then we first check for the rare case where we
+ // have a nested CSE def that has side-effects and return false if have this case
+ //
+ if (*wbKeepList != nullptr)
+ {
+ Compiler::fgWalkResult result = fgWalkTreePre(&deadTree, optHasCSEdefWithSideeffect, (void*)wbKeepList);
+ if (result == WALK_ABORT)
+ {
+ return false;
+ }
+ }
+
// We need to communicate the 'keepList' to optUnmarkCSEs
// as any part of the 'deadTree' tree that is in the keepList is preserved
// and is not deleted and does not have its ref counts decremented
// We communicate this value using the walkData.pCallbackData field
//
+
Compiler::fgWalkResult result = fgWalkTreePre(&deadTree, optUnmarkCSEs, (void*)wbKeepList);
- return (result != WALK_ABORT);
+ assert(result != WALK_ABORT);
+
+ return true;
}
/*****************************************************************************
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-This folder will be mirrored by the Git-TFS Mirror recursively.
\ No newline at end of file
{
private const int StackallocIntBufferSizeLimit = 128;
- // Workaround for https://github.com/dotnet/coreclr/issues/16197
- [StructLayout(LayoutKind.Sequential, Size = StackallocIntBufferSizeLimit * sizeof(int))]
- struct StackallocIntBuffer
- {
- private int _dummy;
- }
-
private static unsafe void FillStringChecked(string dest, int destPos, string src)
{
Debug.Assert(dest != null);
if (newValue == null)
newValue = string.Empty;
- // Workaround for https://github.com/dotnet/coreclr/issues/16197
- // Span<int> initialSpan = stackalloc int[StackallocIntBufferSizeLimit];
- Span<int> initialSpan; StackallocIntBuffer initialBuffer; unsafe { initialSpan = new Span<int>(&initialBuffer, StackallocIntBufferSizeLimit); }
+ Span<int> initialSpan = stackalloc int[StackallocIntBufferSizeLimit];
var replacementIndices = new ValueListBuilder<int>(initialSpan);
unsafe
using System;
using System.Reflection;
-using System.Runtime;
-using System.Runtime.CompilerServices;
using System.Runtime.Serialization;
using System.Diagnostics;
using System.Reflection.Emit;
public static bool operator ==(MulticastDelegate d1, MulticastDelegate d2)
{
- if ((Object)d1 == null)
- return (Object)d2 == null;
+ if (ReferenceEquals(d1, d2))
+ {
+ return true;
+ }
- return d1.Equals(d2);
+ return d1 is null ? false : d1.Equals(d2);
}
public static bool operator !=(MulticastDelegate d1, MulticastDelegate d2)
{
- if ((Object)d1 == null)
- return (Object)d2 != null;
+ if (ReferenceEquals(d1, d2))
+ {
+ return false;
+ }
- return !d1.Equals(d2);
+ return d1 is null ? true : !d1.Equals(d2);
}
public override sealed int GetHashCode()
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-This folder will be mirrored by the Git-TFS Mirror recursively.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-This folder will be mirrored by the Git-TFS Mirror recursively.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-This folder will be mirrored by the Git-TFS Mirror recursively.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
{
LIMITED_METHOD_CONTRACT;
- BOOL fIsSameInstance = FALSE;
+ BOOL fIsSameInstance = (pBinderA == pBinderB);
- if ((pBinderA != NULL) && (pBinderB != NULL))
+ if (!fIsSameInstance && (pBinderA != NULL) && (pBinderB != NULL))
{
// Get the ID for the first binder
UINT_PTR binderIDA = 0, binderIDB = 0;
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
_ASSERTE (OwnLock());
#endif
- DWORD cbNewSize = g_rgPrimes[m_iPrimeIndex = NewSize()];
+ UPTR newPrimeIndex = NewSize();
- ASSERT(m_iPrimeIndex < 70);
+ ASSERT(newPrimeIndex < g_rgNumPrimes);
+
+ if ((m_iPrimeIndex == newPrimeIndex) && (m_cbDeletes == 0))
+ {
+ return;
+ }
+
+ m_iPrimeIndex = newPrimeIndex;
+
+ DWORD cbNewSize = g_rgPrimes[m_iPrimeIndex];
Bucket* rgBuckets = Buckets();
UPTR cbCurrSize = GetSize(rgBuckets);
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
CrawlFrame LatchedCF;
};
-
-#if _TARGET_AMD64_
-// Returns the PC for the next instruction
-// If you want to skip ahead of a NOP padding sequence
-// You'll need to call this thing multiple times, until it returns NULL
-
-#define NOP_REX_PREFIX ((char)0x66)
-#define XCHG_EAX_EAX ((char)0x90)
-
-int isAtNop(const void *ip)
-{
- const char *NextByte = (const char *)ip;
- STRESS_LOG1(LF_EH, LL_INFO100, "AMD64 - isAtNop ip 0x%p\n", ip);
-
- int lpfxCount = 0;
- //
- // Read in length prefixes - no effect
- //
- for (lpfxCount = 0; lpfxCount < 14; lpfxCount++)
- {
- if (NextByte[lpfxCount] != NOP_REX_PREFIX)
- break;
- }
-
- //
- // xchg eax, eax
- //
- if (NextByte[lpfxCount] == XCHG_EAX_EAX)
- return (lpfxCount + 1);
- return 0;
-}
-#endif // _TARGET_AMD64_
-
// Crawl the stack looking for Thread Abort related information (whether we're executing inside a CER or an error handling clauses
// of some sort).
static StackWalkAction TAStackCrawlCallBackWorker(CrawlFrame* pCf, StackCrawlContext *pData)
}
#endif // !WIN64EXCEPTIONS
-#if _TARGET_AMD64_
- STRESS_LOG1(LF_EH, LL_INFO10, "AMD64 - in TAStackCrawlCallBack 0x%x offset\n", offs);
- STRESS_LOG1(LF_EH, LL_INFO10, "AMD64 - in TAStackCrawlCallBack frame IP is 0x%p\n", (void *)GetControlPC(pCf->GetRegisterSet()));
- STRESS_LOG3(LF_EH, LL_INFO100, "AMD64 - in TAStackCrawlCallBack: STACKCRAWL method:%pM (), Frame:%p, FrameVtable = %pV\n",
- pMD, pFrame, pCf->IsFrameless()?0:(*(void**)pFrame));
-
- DWORD OffsSkipNop = offs;
-
- if ( pCf->IsFrameless() && pCf->IsActiveFrame())
- {
- // If the frame is the top most frame and is managed,
- // get the ip
- void *oldIP = (void *)GetControlPC(pCf->GetRegisterSet());
-
- // skip over the nop to get newIP
- int bNop = isAtNop(oldIP);
-
- // Skip over the nop if any
- OffsSkipNop += bNop;
-
- if (bNop != 0)
- {
- STRESS_LOG1(LF_EH, LL_INFO100, "AMD64 - TAStackCrawlCallBack: STACKCRAWL new Offset 0x%x V\n", OffsSkipNop );
- }
- }
-#endif // _TARGET_AMD64_
-
-
for(ULONG i=0; i < EHCount; i++)
{
pJitManager->GetNextEHClause(&pEnumState, &EHClause);
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
+++ /dev/null
-Only contents of this folder, excluding subfolders, will be mirrored by the Git-TFS Mirror.
\ No newline at end of file
set __CollectDumps=
set __DoCrossgen=
set __CrossgenAltJit=
+set __PerfTests=
:Arg_Loop
if "%1" == "" goto ArgsDone
shift
:ArgsDone
+:: Done with argument processing. Check argument values for validity.
+
+if defined __TestEnv (if not exist %__TestEnv% echo %__MsgPrefix%Error: Test Environment script %__TestEnv% not found && exit /b 1)
+if "%__PerfTests%"=="true" (if defined __GenerateLayoutOnly echo %__MsgPrefix%Error: Don't specify both "PerfTests" and "GenerateLayoutOnly" && exit /b 1)
+
:: Set the remaining variables based upon the determined configuration
set "__BinDir=%__RootBinDir%\Product\%__BuildOS%.%__BuildArch%.%__BuildType%"
set "__TestWorkingDir=%__RootBinDir%\tests\%__BuildOS%.%__BuildArch%.%__BuildType%"
if not defined XunitTestBinBase set XunitTestBinBase=%__TestWorkingDir%
if not defined XunitTestReportDirBase set XunitTestReportDirBase=%XunitTestBinBase%\Reports\
-if not exist %__LogsDir% md %__LogsDir%
+:: Set up msbuild and tools environment. Check if msbuild and VS exist.
set _msbuildexe=
if /i "%__VSVersion%" == "vs2017" (
- set "__VSToolsRoot=%VS150COMNTOOLS%"
- set "__VCToolsRoot=%VS150COMNTOOLS%\..\..\VC\Auxiliary\Build"
+ set "__VSToolsRoot=%VS150COMNTOOLS%"
+ set "__VCToolsRoot=%VS150COMNTOOLS%\..\..\VC\Auxiliary\Build"
- set _msbuildexe="%VS150COMNTOOLS%\..\..\MSBuild\15.0\Bin\MSBuild.exe"
+ set _msbuildexe="%VS150COMNTOOLS%\..\..\MSBuild\15.0\Bin\MSBuild.exe"
) else if /i "%__VSVersion%" == "vs2015" (
- set "__VSToolsRoot=%VS140COMNTOOLS%"
- set "__VCToolsRoot=%VS140COMNTOOLS%\..\..\VC"
+ set "__VSToolsRoot=%VS140COMNTOOLS%"
+ set "__VCToolsRoot=%VS140COMNTOOLS%\..\..\VC"
- set _msbuildexe="%ProgramFiles(x86)%\MSBuild\14.0\Bin\MSBuild.exe"
- if not exist !_msbuildexe! set _msbuildexe="%ProgramFiles%\MSBuild\14.0\Bin\MSBuild.exe"
+ set _msbuildexe="%ProgramFiles(x86)%\MSBuild\14.0\Bin\MSBuild.exe"
+ if not exist !_msbuildexe! set _msbuildexe="%ProgramFiles%\MSBuild\14.0\Bin\MSBuild.exe"
)
:: Does VS really exist?
if not exist "%__VSToolsRoot%\VsDevCmd.bat" goto NoVS
:: Does MSBuild really exist?
-if not exist %_msbuildexe% echo %__MsgPrefix%Error: Could not find MSBuild.exe. Please see https://github.com/dotnet/coreclr/blob/master/Documentation/project-docs/developer-guide.md for build instructions. && exit /b 1
+if not exist %_msbuildexe% (
+ echo %__MsgPrefix%Error: Could not find MSBuild.exe. Please see https://github.com/dotnet/coreclr/blob/master/Documentation/project-docs/developer-guide.md for build instructions.
+ exit /b 1
+)
if not defined VSINSTALLDIR (
echo %__MsgPrefix%Error: runtest.cmd should be run from a Visual Studio Command Prompt. Please see https://github.com/dotnet/coreclr/blob/master/Documentation/project-docs/developer-guide.md for build instructions.
set __msbuildCommonArgs=%__msbuildCommonArgs% /p:RunTestsViaIllink=true
)
+if not exist %__LogsDir% md %__LogsDir%
+
+REM These log files are created automatically by the test run process. Q: what do they depend on being set?
+set __TestRunHtmlLog=%__LogsDir%\TestRun_%__BuildOS%__%__BuildArch%__%__BuildType%.html
+set __TestRunXmlLog=%__LogsDir%\TestRun_%__BuildOS%__%__BuildArch%__%__BuildType%.xml
+
REM Prepare the Test Drop
-echo %__MsgPrefix%Removing 'ni' files and 'lock' folders from %__TestWorkingDir%
-REM Cleans any NI from the last run
-powershell -NoProfile "Get-ChildItem -path %__TestWorkingDir% -Include '*.ni.*' -Recurse -Force | Remove-Item -force"
-REM Cleans up any lock folder used for synchronization from last run
-powershell -NoProfile "Get-ChildItem -path %__TestWorkingDir% -Include 'lock' -Recurse -Force | where {$_.Attributes -eq 'Directory'}| Remove-Item -force -Recurse"
+
+if not defined __GenerateLayoutOnly (
+ echo %__MsgPrefix%Removing 'ni' files and 'lock' folders from %__TestWorkingDir%
+ REM Cleans any NI from the last run
+ powershell -NoProfile "Get-ChildItem -path %__TestWorkingDir% -Include '*.ni.*' -Recurse -Force | Remove-Item -force"
+ REM Cleans up any lock folder used for synchronization from last run
+ powershell -NoProfile "Get-ChildItem -path %__TestWorkingDir% -Include 'lock' -Recurse -Force | where {$_.Attributes -eq 'Directory'}| Remove-Item -force -Recurse"
+)
if defined CORE_ROOT goto SkipCoreRootSetup
:SkipCoreRootSetup
+if not exist %CORE_ROOT%\coreclr.dll (
+ echo %__MsgPrefix%Error: Ensure you have done a successful build of the Product and %CORE_ROOT% contains runtime binaries.
+ exit /b 1
+)
-if defined __TestEnv (if not exist %__TestEnv% echo %__MsgPrefix%Error: Test Environment script %__TestEnv% not found && exit /b 1)
-
-REM These log files are created automatically by the test run process. Q: what do they depend on being set?
-set __TestRunHtmlLog=%__LogsDir%\TestRun_%__BuildOS%__%__BuildArch%__%__BuildType%.html
-set __TestRunXmlLog=%__LogsDir%\TestRun_%__BuildOS%__%__BuildArch%__%__BuildType%.xml
+if "%__PerfTests%"=="true" goto RunPerfTests
+REM =========================================================================================
+REM ===
+REM === Run normal (non-perf) tests
+REM ===
+REM =========================================================================================
-if "%__PerfTests%"=="true" goto RunPerfTests
+call :SetTestEnvironment
-call :ResolveDependecies
+call :ResolveDependencies
+if errorlevel 1 exit /b 1
if defined __DoCrossgen call :PrecompileFX
-if defined __GenerateLayoutOnly (
- REM Delete the unecessary mscorlib.ni file.
- if exist %CORE_ROOT%\mscorlib.ni.dll del %CORE_ROOT%\mscorlib.ni.dll
- exit /b 0
-)
+REM Delete the unecessary mscorlib.ni file.
+if exist %CORE_ROOT%\mscorlib.ni.dll del %CORE_ROOT%\mscorlib.ni.dll
-if not exist %CORE_ROOT%\coreclr.dll (
- echo %__MsgPrefix%Error: Ensure you have done a successful build of the Product and %CORE_ROOT% contains runtime binaries.
- exit /b 1
+if defined __GenerateLayoutOnly (
+ exit /b 0
)
::Check if the test Binaries are built
echo %__MsgPrefix%CORE_ROOT that will be used is: %CORE_ROOT%
echo %__MsgPrefix%Starting the test run ...
-REM Delete the unecessary mscorlib.ni file.
-if exist %CORE_ROOT%\mscorlib.ni.dll del %CORE_ROOT%\mscorlib.ni.dll
-
set __BuildLogRootName=TestRunResults
call :msbuild "%__ProjectFilesDir%\runtest.proj" /p:Runtests=true /clp:showcommandline
set __errorlevel=%errorlevel%
exit /b 1
)
-if not defined __PerfTests goto :SkipRunPerfTests
+goto TestsDone
+
+REM =========================================================================================
+REM ===
+REM === Run perf tests
+REM ===
+REM =========================================================================================
:RunPerfTests
echo %__MsgPrefix%CORE_ROOT that will be used is: %CORE_ROOT%
echo Html report: %__TestRunHtmlLog%
)
-:SkipRunPerfTests
+goto TestsDone
REM =========================================================================================
REM ===
REM ===
REM =========================================================================================
+:TestsDone
+
echo %__MsgPrefix%Test run successful. Refer to the log files for details:
echo %__TestRunHtmlLog%
echo %__TestRunXmlLog%
REM =========================================================================================
REM ===
-REM === Helper routines
+REM === Compile the managed assemblies in Core_ROOT before running the tests
REM ===
REM =========================================================================================
-REM Compile the managed assemblies in Core_ROOT before running the tests
:PrecompileAssembly
if defined __JitDisasm goto :jitdisasm
endlocal
exit /b 0
+REM =========================================================================================
+REM ===
+REM === Subroutine to invoke msbuild.
+REM ===
+REM === All arguments are passed to msbuild. The first argument should be the .proj file to invoke.
+REM ===
+REM === On entry, environment variable __BuildLogRootName must be set to a file name prefix for the generated log files.
+REM === All the "standard" environment variables that aren't expected to change per invocation must also be set,
+REM === like __msbuildCommonArgs.
+REM ===
+REM === The build log files will be overwritten, not appended to.
+REM ===
+REM =========================================================================================
+
:msbuild
-@REM Subroutine to invoke msbuild. All arguments are passed to msbuild. The first argument should be the
-@REM .proj file to invoke.
-@REM
-@REM On entry, __BuildLogRootName must be set to a file name prefix for the generated log file.
-@REM All the "standard" environment variables that aren't expected to change per invocation must also be set,
-@REM like __msbuildCommonArgs.
-@REM
-@REM The build log files will be overwritten, not appended to.
echo %__MsgPrefix%Invoking msbuild
exit /b 0
-:ResolveDependecies:
+REM =========================================================================================
+REM ===
+REM === Set various environment variables, based on arguments to this script, before invoking the tests.
+REM ===
+REM =========================================================================================
-if "%CORE_ROOT%" == "" (
- echo %__MsgPrefix%Error: Ensure you have done a successful build of the Product and Run - runtest BuildArch BuildType {path to product binaries}.
- exit /b 1
-)
+:SetTestEnvironment
:: Long GC tests take about 10 minutes per test on average, so
:: they often bump up against the default 10 minute timeout.
set RunningIlasmRoundTrip=1
)
+exit /b 0
+
+REM =========================================================================================
+REM ===
+REM === Generate the "layout" directory in CORE_ROOT; download dependencies.
+REM ===
+REM =========================================================================================
+
+:ResolveDependencies
set __BuildLogRootName=Tests_GenerateRuntimeLayout
call :msbuild "%__ProjectFilesDir%\runtest.proj" /p:GenerateRuntimeLayout=true
if errorlevel 1 (
exit /b 0
-
+REM =========================================================================================
+REM ===
+REM === Display a help message describing how to use this script.
+REM ===
+REM =========================================================================================
:Usage
@REM NOTE: The caret character is used to escape meta-characters known to the CMD shell. This character does
echo timeout ^<n^> - Sets the per-test timeout in milliseconds ^(default is 10 minutes = 10 * 60 * 1000 = 600000^).
echo Note: some options override this ^(gcstresslevel, longgc, gcsimulator^).
echo msbuildargs ^<args...^> - Pass all subsequent args directly to msbuild invocations.
-echo ^<CORE_ROOT^> - Path to the runtime to test (if specified).
+echo ^<CORE_ROOT^> - Path to the runtime to test ^(if specified^).
echo.
echo Note that arguments are not case-sensitive.
echo.
echo Examples:
echo %0 x86 checked
-echo %0 x64 release GenerateLayoutOnly
+echo %0 x64 checked GenerateLayoutOnly
+echo %0 x64 release
exit /b 1
:NoVS
-echo Visual Studio 2015 or 2017 (Community is free) is a prerequisite to build this repository.
+echo Visual Studio 2015 or 2017 ^(Community is free^) is a prerequisite to build this repository.
echo See: https://github.com/dotnet/coreclr/blob/master/Documentation/project-docs/developer-guide.md#prerequisites
exit /b 1
--- /dev/null
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+//
+
+// The bug captured by this test was a case where:
+// - We have COMPlus_JitStressRegs=3, so we're limiting the available registers.
+// - We have a DIV with two double operands that are casts from int lclVars, and it is passed to a call.
+// - We have 4 float lclVars in registers:
+// - One is active in a caller-save register (that will be x in our case)
+// - One is active in a callee-save register (y)
+// - One is inactive in a caller-save register (z)
+// - One is inactive in a callee-save register (w)
+// - When we allocate the def (target) register for the second cast, we spill the first one.
+// - When we try to reload it, we were incorrectly returning false from 'isRegInUse()'
+// for the inactive interval in the second half.
+
+using System;
+using System.Runtime.CompilerServices;
+
+public class DevDiv_543057
+
+{
+ public const int Pass = 100;
+ public const int Fail = -1;
+
+ [MethodImplAttribute(MethodImplOptions.NoInlining)]
+ public static float GetFloat(int i)
+ {
+ return (float)i;
+ }
+ [MethodImplAttribute(MethodImplOptions.NoInlining)]
+ public static int test(int i, int j)
+ {
+ // x and y will be preferenced to callee-save
+ // they need to have enough references to qualify for callee-save
+ // z and w will not
+ // x and z will be inactive at the call to Math.Ceiling
+ // y and w will be active
+ float x = GetFloat(1);
+ float y = GetFloat(2);
+ float z = GetFloat(3);
+ // We want w in f1. At this point z is likely to be in f0.
+ // So define 'result' first.
+ float result = x - y;
+ float w = x + y + z;
+ if (i != j)
+ {
+ // Here all our floats are in registers. z is going to be redefined, so it is inactive,
+ // and w is not used except in the else clause so it is also inactive.
+ z = (float) Math.Ceiling(((double)i) / ((double)j));
+ // Now we use x and y so that they are live across the call to Math.Ceiling.
+ result = z + y + w;
+ }
+ else
+ {
+ // Here we need to use all of our float arguments so that they are all live.
+ y = x * y * z * w;
+ x = y * 2;
+ // Now x and y are going to be live across this call, to encourage them to get a callee-save reg.
+ Console.WriteLine("FAIL");
+ // And use x a couple more times.
+ x *= y;
+ result += x + y;
+ }
+ Console.WriteLine("Result: " + result);
+ return Pass;
+ }
+ public static int Main()
+ {
+ return test(5, 6);
+ }
+}
+
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+ <OutputType>Exe</OutputType>
+ <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+ <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+ </PropertyGroup>
+ <!-- Default configurations to help VS understand the configurations -->
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ </PropertyGroup>
+ <ItemGroup>
+ <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+ <Visible>False</Visible>
+ </CodeAnalysisDependentAssemblyPaths>
+ </ItemGroup>
+ <PropertyGroup>
+ <DebugType></DebugType>
+ <Optimize>True</Optimize>
+ </PropertyGroup>
+ <ItemGroup>
+ <Compile Include="$(MSBuildProjectName).cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+ </ItemGroup>
+ <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+ <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+ </PropertyGroup>
+</Project>