diff options
Diffstat (limited to 'compiler/optimizing/graph_checker.cc')
-rw-r--r-- | compiler/optimizing/graph_checker.cc | 60 |
1 files changed, 16 insertions, 44 deletions
diff --git a/compiler/optimizing/graph_checker.cc b/compiler/optimizing/graph_checker.cc index e8c94dd6b4..8f2f25355d 100644 --- a/compiler/optimizing/graph_checker.cc +++ b/compiler/optimizing/graph_checker.cc @@ -27,6 +27,7 @@ #include "base/scoped_arena_containers.h" #include "code_generator.h" #include "handle.h" +#include "intrinsics.h" #include "mirror/class.h" #include "nodes.h" #include "obj_ptr-inl.h" @@ -738,50 +739,21 @@ void GraphChecker::VisitInvoke(HInvoke* invoke) { // 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; + if (IsIntrinsicWithSpecializedHir(invoke->GetIntrinsic()) && + // FIXME: The inliner can currently create graphs with any of the intrinsics with HIR. + // However, we are able to compensate for `StringCharAt` and `StringLength` in the + // `HInstructionSimplifier`, so we're allowing these two intrinsics for now, preserving + // the old behavior. Besides fixing the bug, we should also clean up the simplifier + // and remove `SimplifyStringCharAt` and `SimplifyStringLength`. Bug: 319045458 + invoke->GetIntrinsic() != Intrinsics::kStringCharAt && + invoke->GetIntrinsic() != Intrinsics::kStringLength) { + AddError( + StringPrintf("The graph contains the instrinsic %d which should have been replaced in the " + "instruction builder: %s:%d in block %d.", + enum_cast<int>(invoke->GetIntrinsic()), + invoke->DebugName(), + invoke->GetId(), + invoke->GetBlock()->GetBlockId())); } } |