From: Sinan Kaya <41809318+franksinankaya@users.noreply.github.com> Date: Thu, 17 Oct 2019 16:58:05 +0000 (-0700) Subject: Replace gtIntrinsic. with AsIntrinsic() X-Git-Tag: submit/tizen/20210909.063632~11030^2~351 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=20bb2d27a1abd7cea75a9ca35e8684f26276ed5a;p=platform%2Fupstream%2Fdotnet%2Fruntime.git Replace gtIntrinsic. with AsIntrinsic() Commit migrated from https://github.com/dotnet/coreclr/commit/a0cd1b84bdf47d784dde57b212c896df37366c92 --- diff --git a/src/coreclr/src/jit/codegenarmarch.cpp b/src/coreclr/src/jit/codegenarmarch.cpp index c95ee7c..86e1adb 100644 --- a/src/coreclr/src/jit/codegenarmarch.cpp +++ b/src/coreclr/src/jit/codegenarmarch.cpp @@ -625,7 +625,7 @@ void CodeGen::genIntrinsic(GenTree* treeNode) // Right now only Abs/Ceiling/Floor/Round/Sqrt are treated as math intrinsics. // - switch (treeNode->gtIntrinsic.gtIntrinsicId) + switch (treeNode->AsIntrinsic()->gtIntrinsicId) { case CORINFO_INTRINSIC_Abs: genConsumeOperands(treeNode->AsOp()); diff --git a/src/coreclr/src/jit/codegenxarch.cpp b/src/coreclr/src/jit/codegenxarch.cpp index 21edf6c..a07bea2 100644 --- a/src/coreclr/src/jit/codegenxarch.cpp +++ b/src/coreclr/src/jit/codegenxarch.cpp @@ -7013,7 +7013,7 @@ void CodeGen::genSSE2BitwiseOp(GenTree* treeNode) break; case GT_INTRINSIC: - assert(treeNode->gtIntrinsic.gtIntrinsicId == CORINFO_INTRINSIC_Abs); + assert(treeNode->AsIntrinsic()->gtIntrinsicId == CORINFO_INTRINSIC_Abs); // Abs(x) = set sign-bit to zero // Abs(f) = f & 0x7fffffff @@ -7116,7 +7116,7 @@ void CodeGen::genSSE41RoundOp(GenTreeOp* treeNode) unsigned ival = 0; // v) tree oper is CORINFO_INTRINSIC_Round, _Ceiling, or _Floor - switch (treeNode->gtIntrinsic.gtIntrinsicId) + switch (treeNode->AsIntrinsic()->gtIntrinsicId) { case CORINFO_INTRINSIC_Round: ival = 4; @@ -7252,7 +7252,7 @@ void CodeGen::genSSE41RoundOp(GenTreeOp* treeNode) void CodeGen::genIntrinsic(GenTree* treeNode) { // Right now only Sqrt/Abs are treated as math intrinsics. - switch (treeNode->gtIntrinsic.gtIntrinsicId) + switch (treeNode->AsIntrinsic()->gtIntrinsicId) { case CORINFO_INTRINSIC_Sqrt: { diff --git a/src/coreclr/src/jit/compiler.cpp b/src/coreclr/src/jit/compiler.cpp index ab9488a..2c2170a 100644 --- a/src/coreclr/src/jit/compiler.cpp +++ b/src/coreclr/src/jit/compiler.cpp @@ -10495,7 +10495,7 @@ void cNodeIR(Compiler* comp, GenTree* tree) } else if (op == GT_INTRINSIC) { - CorInfoIntrinsics intrin = tree->gtIntrinsic.gtIntrinsicId; + CorInfoIntrinsics intrin = tree->AsIntrinsic()->gtIntrinsicId; chars += printf(":"); switch (intrin) diff --git a/src/coreclr/src/jit/gentree.cpp b/src/coreclr/src/jit/gentree.cpp index fe97ce0..627c612 100644 --- a/src/coreclr/src/jit/gentree.cpp +++ b/src/coreclr/src/jit/gentree.cpp @@ -1408,7 +1408,7 @@ AGAIN: switch (oper) { case GT_INTRINSIC: - if (op1->gtIntrinsic.gtIntrinsicId != op2->gtIntrinsic.gtIntrinsicId) + if (op1->AsIntrinsic()->gtIntrinsicId != op2->AsIntrinsic()->gtIntrinsicId) { return false; } @@ -2091,7 +2091,7 @@ AGAIN: switch (oper) { case GT_INTRINSIC: - hash += tree->gtIntrinsic.gtIntrinsicId; + hash += tree->AsIntrinsic()->gtIntrinsicId; break; case GT_LEA: hash += static_cast(tree->AsAddrMode()->Offset() << 3) + tree->AsAddrMode()->gtScale; @@ -3549,7 +3549,7 @@ unsigned Compiler::gtSetEvalOrder(GenTree* tree) // GT_INTRINSIC intrinsics Sin, Cos, Sqrt, Abs ... have higher costs. // TODO: tune these costs target specific as some of these are // target intrinsics and would cost less to generate code. - switch (tree->gtIntrinsic.gtIntrinsicId) + switch (tree->AsIntrinsic()->gtIntrinsicId) { default: assert(!"missing case for gtIntrinsicId"); @@ -4076,7 +4076,7 @@ unsigned Compiler::gtSetEvalOrder(GenTree* tree) case GT_INTRINSIC: - switch (tree->gtIntrinsic.gtIntrinsicId) + switch (tree->AsIntrinsic()->gtIntrinsicId) { case CORINFO_INTRINSIC_Atan2: case CORINFO_INTRINSIC_Pow: @@ -7333,9 +7333,9 @@ GenTree* Compiler::gtCloneExpr( case GT_INTRINSIC: copy = new (this, GT_INTRINSIC) GenTreeIntrinsic(tree->TypeGet(), tree->AsOp()->gtOp1, tree->AsOp()->gtOp2, - tree->gtIntrinsic.gtIntrinsicId, tree->gtIntrinsic.gtMethodHandle); + tree->AsIntrinsic()->gtIntrinsicId, tree->AsIntrinsic()->gtMethodHandle); #ifdef FEATURE_READYTORUN_COMPILER - copy->gtIntrinsic.gtEntryPoint = tree->gtIntrinsic.gtEntryPoint; + copy->AsIntrinsic()->gtEntryPoint = tree->AsIntrinsic()->gtEntryPoint; #endif break; @@ -10957,7 +10957,7 @@ void Compiler::gtDispTree(GenTree* tree, if (tree->gtOper == GT_INTRINSIC) { - switch (tree->gtIntrinsic.gtIntrinsicId) + switch (tree->AsIntrinsic()->gtIntrinsicId) { case CORINFO_INTRINSIC_Sin: printf(" sin"); @@ -15579,7 +15579,7 @@ Compiler::TypeProducerKind Compiler::gtGetTypeProducerKind(GenTree* tree) } } } - else if ((tree->gtOper == GT_INTRINSIC) && (tree->gtIntrinsic.gtIntrinsicId == CORINFO_INTRINSIC_Object_GetType)) + else if ((tree->gtOper == GT_INTRINSIC) && (tree->AsIntrinsic()->gtIntrinsicId == CORINFO_INTRINSIC_Object_GetType)) { return TPK_GetType; } diff --git a/src/coreclr/src/jit/importer.cpp b/src/coreclr/src/jit/importer.cpp index 3e677d3..7f05f07 100644 --- a/src/coreclr/src/jit/importer.cpp +++ b/src/coreclr/src/jit/importer.cpp @@ -7502,12 +7502,12 @@ var_types Compiler::impImportCall(OPCODE opcode, if (opts.IsReadyToRun()) { noway_assert(callInfo->kind == CORINFO_CALL); - call->gtIntrinsic.gtEntryPoint = callInfo->codePointerLookup.constLookup; + call->AsIntrinsic()->gtEntryPoint = callInfo->codePointerLookup.constLookup; } else { - call->gtIntrinsic.gtEntryPoint.addr = nullptr; - call->gtIntrinsic.gtEntryPoint.accessType = IAT_VALUE; + call->AsIntrinsic()->gtEntryPoint.addr = nullptr; + call->AsIntrinsic()->gtEntryPoint.accessType = IAT_VALUE; } } #endif @@ -19894,7 +19894,7 @@ bool Compiler::IsMathIntrinsic(CorInfoIntrinsics intrinsicId) bool Compiler::IsMathIntrinsic(GenTree* tree) { - return (tree->OperGet() == GT_INTRINSIC) && IsMathIntrinsic(tree->gtIntrinsic.gtIntrinsicId); + return (tree->OperGet() == GT_INTRINSIC) && IsMathIntrinsic(tree->AsIntrinsic()->gtIntrinsicId); } //------------------------------------------------------------------------ diff --git a/src/coreclr/src/jit/lowerxarch.cpp b/src/coreclr/src/jit/lowerxarch.cpp index 0a763e9..a6bdba2 100644 --- a/src/coreclr/src/jit/lowerxarch.cpp +++ b/src/coreclr/src/jit/lowerxarch.cpp @@ -2276,7 +2276,7 @@ void Lowering::ContainCheckIntrinsic(GenTreeOp* node) { assert(node->OperIs(GT_INTRINSIC)); - CorInfoIntrinsics intrinsicId = node->gtIntrinsic.gtIntrinsicId; + CorInfoIntrinsics intrinsicId = node->AsIntrinsic()->gtIntrinsicId; if (intrinsicId == CORINFO_INTRINSIC_Sqrt || intrinsicId == CORINFO_INTRINSIC_Round || intrinsicId == CORINFO_INTRINSIC_Ceiling || intrinsicId == CORINFO_INTRINSIC_Floor) diff --git a/src/coreclr/src/jit/lsraarm.cpp b/src/coreclr/src/jit/lsraarm.cpp index b226f77..6f06cbf 100644 --- a/src/coreclr/src/jit/lsraarm.cpp +++ b/src/coreclr/src/jit/lsraarm.cpp @@ -273,7 +273,7 @@ int LinearScan::BuildNode(GenTree* tree) BuildUse(op1); srcCount = 1; - switch (tree->gtIntrinsic.gtIntrinsicId) + switch (tree->AsIntrinsic()->gtIntrinsicId) { case CORINFO_INTRINSIC_Abs: case CORINFO_INTRINSIC_Sqrt: diff --git a/src/coreclr/src/jit/lsraarm64.cpp b/src/coreclr/src/jit/lsraarm64.cpp index 6bfc080..198c003 100644 --- a/src/coreclr/src/jit/lsraarm64.cpp +++ b/src/coreclr/src/jit/lsraarm64.cpp @@ -315,11 +315,11 @@ int LinearScan::BuildNode(GenTree* tree) case GT_INTRINSIC: { - noway_assert((tree->gtIntrinsic.gtIntrinsicId == CORINFO_INTRINSIC_Abs) || - (tree->gtIntrinsic.gtIntrinsicId == CORINFO_INTRINSIC_Ceiling) || - (tree->gtIntrinsic.gtIntrinsicId == CORINFO_INTRINSIC_Floor) || - (tree->gtIntrinsic.gtIntrinsicId == CORINFO_INTRINSIC_Round) || - (tree->gtIntrinsic.gtIntrinsicId == CORINFO_INTRINSIC_Sqrt)); + noway_assert((tree->AsIntrinsic()->gtIntrinsicId == CORINFO_INTRINSIC_Abs) || + (tree->AsIntrinsic()->gtIntrinsicId == CORINFO_INTRINSIC_Ceiling) || + (tree->AsIntrinsic()->gtIntrinsicId == CORINFO_INTRINSIC_Floor) || + (tree->AsIntrinsic()->gtIntrinsicId == CORINFO_INTRINSIC_Round) || + (tree->AsIntrinsic()->gtIntrinsicId == CORINFO_INTRINSIC_Sqrt)); // Both operand and its result must be of the same floating point type. GenTree* op1 = tree->gtGetOp1(); diff --git a/src/coreclr/src/jit/lsraxarch.cpp b/src/coreclr/src/jit/lsraxarch.cpp index 35e02da..760bbca 100644 --- a/src/coreclr/src/jit/lsraxarch.cpp +++ b/src/coreclr/src/jit/lsraxarch.cpp @@ -1765,7 +1765,7 @@ int LinearScan::BuildIntrinsic(GenTree* tree) assert(op1->TypeGet() == tree->TypeGet()); RefPosition* internalFloatDef = nullptr; - switch (tree->gtIntrinsic.gtIntrinsicId) + switch (tree->AsIntrinsic()->gtIntrinsicId) { case CORINFO_INTRINSIC_Abs: // Abs(float x) = x & 0x7fffffff @@ -1780,7 +1780,7 @@ int LinearScan::BuildIntrinsic(GenTree* tree) // xmm register. When we add support in emitter to emit 128-bit // data constants and instructions that operate on 128-bit // memory operands we can avoid the need for an internal register. - if (tree->gtIntrinsic.gtIntrinsicId == CORINFO_INTRINSIC_Abs) + if (tree->AsIntrinsic()->gtIntrinsicId == CORINFO_INTRINSIC_Abs) { internalFloatDef = buildInternalFloatRegisterDefForNode(tree, internalFloatRegCandidates()); } diff --git a/src/coreclr/src/jit/morph.cpp b/src/coreclr/src/jit/morph.cpp index 30ce8a6..f380b69 100644 --- a/src/coreclr/src/jit/morph.cpp +++ b/src/coreclr/src/jit/morph.cpp @@ -11438,7 +11438,7 @@ GenTree* Compiler::fgMorphSmpOp(GenTree* tree, MorphAddrContext* mac) #ifdef _TARGET_ARM_ case GT_INTRINSIC: - if (tree->gtIntrinsic.gtIntrinsicId == CORINFO_INTRINSIC_Round) + if (tree->AsIntrinsic()->gtIntrinsicId == CORINFO_INTRINSIC_Round) { switch (tree->TypeGet()) { diff --git a/src/coreclr/src/jit/rationalize.cpp b/src/coreclr/src/jit/rationalize.cpp index 79046f0..53db75c 100644 --- a/src/coreclr/src/jit/rationalize.cpp +++ b/src/coreclr/src/jit/rationalize.cpp @@ -745,7 +745,7 @@ Compiler::fgWalkResult Rationalizer::RewriteNode(GenTree** useEdge, Compiler::Ge case GT_INTRINSIC: // Non-target intrinsics should have already been rewritten back into user calls. - assert(comp->IsTargetIntrinsic(node->gtIntrinsic.gtIntrinsicId)); + assert(comp->IsTargetIntrinsic(node->AsIntrinsic()->gtIntrinsicId)); break; case GT_BLK: @@ -896,7 +896,7 @@ void Rationalizer::DoPhase() { GenTree* const node = *use; if (node->OperGet() == GT_INTRINSIC && - m_rationalizer.comp->IsIntrinsicImplementedByUserCall(node->gtIntrinsic.gtIntrinsicId)) + m_rationalizer.comp->IsIntrinsicImplementedByUserCall(node->AsIntrinsic()->gtIntrinsicId)) { m_rationalizer.RewriteIntrinsicAsUserCall(use, this->m_ancestors); }