From: Steve MacLean Date: Wed, 14 Feb 2018 17:27:03 +0000 (-0500) Subject: [Arm64] Mark removed compare zero nodes unused X-Git-Tag: accepted/tizen/unified/20190422.045933~2669^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=27029a02843d3b7b6e8e75cbcc9e35d57a361564;p=platform%2Fupstream%2Fcoreclr.git [Arm64] Mark removed compare zero nodes unused --- diff --git a/src/jit/lowerarmarch.cpp b/src/jit/lowerarmarch.cpp index b058acb..10f182f 100644 --- a/src/jit/lowerarmarch.cpp +++ b/src/jit/lowerarmarch.cpp @@ -540,13 +540,6 @@ void Lowering::LowerHWIntrinsic(GenTreeHWIntrinsic* node) switch (intrinsicID) { - case NI_ARM64_SIMD_GE_ZERO: - // Unsigned >= 0 ==> Always true - node->gtHWIntrinsicId = setAllVector; - node->gtOp.gtOp1 = comp->gtNewLconNode(~0ULL); - BlockRange().InsertBefore(node, node->gtOp.gtOp1); - BlockRange().Remove(origOp1); - break; case NI_ARM64_SIMD_GT_ZERO: // Unsigned > 0 ==> !(Unsigned == 0) node->gtOp.gtOp1 = @@ -559,12 +552,21 @@ void Lowering::LowerHWIntrinsic(GenTreeHWIntrinsic* node) // Unsigned <= 0 ==> Unsigned == 0 node->gtHWIntrinsicId = NI_ARM64_SIMD_EQ_ZERO; break; + case NI_ARM64_SIMD_GE_ZERO: case NI_ARM64_SIMD_LT_ZERO: + // Unsigned >= 0 ==> Always true // Unsigned < 0 ==> Always false node->gtHWIntrinsicId = setAllVector; - node->gtOp.gtOp1 = comp->gtNewIconNode(0); + node->gtOp.gtOp1 = comp->gtNewLconNode((intrinsicID == NI_ARM64_SIMD_GE_ZERO) ? ~0ULL : 0ULL); BlockRange().InsertBefore(node, node->gtOp.gtOp1); - BlockRange().Remove(origOp1); + if ((origOp1->gtFlags & GTF_ALL_EFFECT) == 0) + { + BlockRange().Remove(origOp1, true); + } + else + { + origOp1->SetUnusedValue(); + } break; default: assert(!"Unhandled LowerCmpUZero case");