From b25dd2d4f93f4925551f469a9535e3abc79081a7 Mon Sep 17 00:00:00 2001 From: Santiago Aboy Solanes Date: Mon, 22 Jan 2024 10:52:17 +0000 Subject: Fix crash when inlining intrinsics with specialized HIR During the inliner phase if we recognize an intrinsic, we insert it. This is problematic since there are some intrinsics which we only expect during the instruction builder phase. This CL skips inlining those intrinsics. Potentially, we could generate the graphs for those intrinsics and inline it, but it needs refactoring of inliner.cc. Bug: 319045458 Fixes: 319045458 Test: art/test/testrunner/testrunner.py --host --64 --optimizing -b Test: Locally compiling the app in the bug Change-Id: Ied3ec87e5655cec3bdfd978eb5c7411ddb102360 --- compiler/optimizing/graph_checker.cc | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'compiler/optimizing/graph_checker.cc') diff --git a/compiler/optimizing/graph_checker.cc b/compiler/optimizing/graph_checker.cc index 8f2f25355d..d4b0bf2e81 100644 --- a/compiler/optimizing/graph_checker.cc +++ b/compiler/optimizing/graph_checker.cc @@ -739,14 +739,7 @@ void GraphChecker::VisitInvoke(HInvoke* invoke) { // Check for intrinsics which should have been replaced by intermediate representation in the // instruction builder. - 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) { + if (!IsValidIntrinsicAfterBuilder(invoke->GetIntrinsic())) { AddError( StringPrintf("The graph contains the instrinsic %d which should have been replaced in the " "instruction builder: %s:%d in block %d.", -- cgit v1.2.3-59-g8ed1b