diff options
author | 2023-11-10 09:45:04 +0000 | |
---|---|---|
committer | 2023-11-14 12:27:20 +0000 | |
commit | 4672ea32db63ab260b0be3b3156ef0fe760e38be (patch) | |
tree | a2f7e389ba1635a9071ea0ab517eeb3ac19e091c /compiler/optimizing/graph_checker.cc | |
parent | 97e821c02dbcc82b2d3c67f8cb15fe620b196fff (diff) |
Move valid intrinsic check to graph checker
Test: art/test/testrunner/testrunner.py --host --64 -b --optimizing
Change-Id: I1edfa3edc9c5e6106cba1cb540dc7fe0d1ae8fc0
Diffstat (limited to 'compiler/optimizing/graph_checker.cc')
-rw-r--r-- | compiler/optimizing/graph_checker.cc | 51 |
1 files changed, 50 insertions, 1 deletions
diff --git a/compiler/optimizing/graph_checker.cc b/compiler/optimizing/graph_checker.cc index f32494bb04..e8c94dd6b4 100644 --- a/compiler/optimizing/graph_checker.cc +++ b/compiler/optimizing/graph_checker.cc @@ -735,10 +735,59 @@ void GraphChecker::VisitInvoke(HInvoke* invoke) { } flag_info_.seen_always_throwing_invokes = true; } + + // Check for intrinsics which should have been replaced by intermediate representation in the + // instruction builder. + switch (invoke->GetIntrinsic()) { + case Intrinsics::kIntegerRotateRight: + case Intrinsics::kLongRotateRight: + case Intrinsics::kIntegerRotateLeft: + case Intrinsics::kLongRotateLeft: + case Intrinsics::kIntegerCompare: + case Intrinsics::kLongCompare: + case Intrinsics::kIntegerSignum: + case Intrinsics::kLongSignum: + case Intrinsics::kFloatIsNaN: + case Intrinsics::kDoubleIsNaN: + case Intrinsics::kStringIsEmpty: + case Intrinsics::kUnsafeLoadFence: + case Intrinsics::kUnsafeStoreFence: + case Intrinsics::kUnsafeFullFence: + case Intrinsics::kJdkUnsafeLoadFence: + case Intrinsics::kJdkUnsafeStoreFence: + case Intrinsics::kJdkUnsafeFullFence: + case Intrinsics::kVarHandleFullFence: + case Intrinsics::kVarHandleAcquireFence: + case Intrinsics::kVarHandleReleaseFence: + case Intrinsics::kVarHandleLoadLoadFence: + case Intrinsics::kVarHandleStoreStoreFence: + case Intrinsics::kMathMinIntInt: + case Intrinsics::kMathMinLongLong: + case Intrinsics::kMathMinFloatFloat: + case Intrinsics::kMathMinDoubleDouble: + case Intrinsics::kMathMaxIntInt: + case Intrinsics::kMathMaxLongLong: + case Intrinsics::kMathMaxFloatFloat: + case Intrinsics::kMathMaxDoubleDouble: + case Intrinsics::kMathAbsInt: + case Intrinsics::kMathAbsLong: + case Intrinsics::kMathAbsFloat: + case Intrinsics::kMathAbsDouble: + AddError( + StringPrintf("The graph contains an instrinsic which should have been replaced in the " + "instruction builder: %s:%d in block %d.", + invoke->DebugName(), + invoke->GetId(), + invoke->GetBlock()->GetBlockId())); + break; + default: + break; + } } void GraphChecker::VisitInvokeStaticOrDirect(HInvokeStaticOrDirect* invoke) { - // We call VisitInvoke and not VisitInstruction to de-duplicate the always throwing code check. + // We call VisitInvoke and not VisitInstruction to de-duplicate the common code: always throwing + // and instrinsic checks. VisitInvoke(invoke); if (invoke->IsStaticWithExplicitClinitCheck()) { |