From ed28ddc66d15470f64fce7ef2c961aafd379873e Mon Sep 17 00:00:00 2001 From: Pat Gavlin Date: Fri, 23 Jun 2017 09:26:42 -0700 Subject: [PATCH] Update compLongUsed in rationalize. 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 | 10 ++++++++-- src/coreclr/src/jit/rationalize.cpp | 5 +++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/coreclr/src/jit/lower.cpp b/src/coreclr/src/jit/lower.cpp index f7b2489..a626ff9 100644 --- a/src/coreclr/src/jit/lower.cpp +++ b/src/coreclr/src/jit/lower.cpp @@ -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); diff --git a/src/coreclr/src/jit/rationalize.cpp b/src/coreclr/src/jit/rationalize.cpp index 79aecf4..0afdff4 100644 --- a/src/coreclr/src/jit/rationalize.cpp +++ b/src/coreclr/src/jit/rationalize.cpp @@ -983,6 +983,11 @@ Compiler::fgWalkResult Rationalizer::RewriteNode(GenTree** useEdge, ArrayStackgtFlags &= ~GTF_CALL; } + + if (node->TypeGet() == TYP_LONG) + { + comp->compLongUsed = true; + } } assert(isLateArg == ((use.Def()->gtFlags & GTF_LATE_ARG) != 0)); -- 2.7.4