Jit: fix some sources of x64 chk/rel diffs (#39888)
authorAndy Ayers <andya@microsoft.com>
Fri, 24 Jul 2020 17:59:16 +0000 (10:59 -0700)
committerGitHub <noreply@github.com>
Fri, 24 Jul 2020 17:59:16 +0000 (10:59 -0700)
Break IGs for perfscores the same way in chk and rel. Also, fix the xarch
peephole to work across extended IGs.

Closes #39845.

src/coreclr/src/jit/codegenlinear.cpp
src/coreclr/src/jit/emitxarch.cpp

index 5ce369b..cf0d1cd 100644 (file)
@@ -344,7 +344,6 @@ void CodeGen::genCodeForBBlist()
             needLabel = true;
         }
 
-#if defined(DEBUG) || defined(LATE_DISASM)
         // We also want to start a new Instruction group by calling emitAddLabel below,
         // when we need accurate bbWeights for this block in the emitter.  We force this
         // whenever our previous block was a BBJ_COND and it has a different weight than us.
@@ -356,7 +355,6 @@ void CodeGen::genCodeForBBlist()
         {
             needLabel = true;
         }
-#endif // DEBUG || LATE_DISASM
 
         if (needLabel)
         {
index 1938efb..5d0efd0 100644 (file)
@@ -163,8 +163,10 @@ bool emitter::IsDstSrcSrcAVXInstruction(instruction ins)
 
 bool emitter::AreUpper32BitsZero(regNumber reg)
 {
-    // Don't look back across IG boundaries (possible control flow)
-    if (emitCurIGinsCnt == 0)
+    // If there are no instructions in this IG, we can look back at
+    // the previous IG's instructions if this IG is an extension.
+    //
+    if ((emitCurIGinsCnt == 0) && ((emitCurIG->igFlags & IGF_EXTEND) == 0))
     {
         return false;
     }