Update compLongUsed in rationalize.
authorPat Gavlin <pagavlin@microsoft.com>
Fri, 23 Jun 2017 16:26:42 +0000 (09:26 -0700)
committerPat Gavlin <pagavlin@microsoft.com>
Sat, 24 Jun 2017 01:02:57 +0000 (18:02 -0700)
This allows us to skip decompisition if long-typed values are not used by a method.

Commit migrated from https://github.com/dotnet/coreclr/commit/2d361dfb2d4da252c800015ba005471377622a7a

src/coreclr/src/jit/lower.cpp
src/coreclr/src/jit/rationalize.cpp

index f7b2489..a626ff9 100644 (file)
@@ -4460,7 +4460,10 @@ void Lowering::DoPhase()
 
 #if !defined(_TARGET_64BIT_)
     DecomposeLongs decomp(comp); // Initialize the long decomposition class.
-    decomp.PrepareForDecomposition();
+    if (comp->compLongUsed)
+    {
+        decomp.PrepareForDecomposition();
+    }
 #endif // !defined(_TARGET_64BIT_)
 
     for (BasicBlock* block = comp->fgFirstBB; block; block = block->bbNext)
@@ -4469,7 +4472,10 @@ void Lowering::DoPhase()
         comp->compCurBB = block;
 
 #if !defined(_TARGET_64BIT_)
-        decomp.DecomposeBlock(block);
+        if (comp->compLongUsed)
+        {
+            decomp.DecomposeBlock(block);
+        }
 #endif //!_TARGET_64BIT_
 
         LowerBlock(block);
index 79aecf4..0afdff4 100644 (file)
@@ -983,6 +983,11 @@ Compiler::fgWalkResult Rationalizer::RewriteNode(GenTree** useEdge, ArrayStack<G
             // Clear the GTF_CALL flag for all nodes but calls
             node->gtFlags &= ~GTF_CALL;
         }
+
+        if (node->TypeGet() == TYP_LONG)
+        {
+            comp->compLongUsed = true;
+        }
     }
 
     assert(isLateArg == ((use.Def()->gtFlags & GTF_LATE_ARG) != 0));