From 7c1dd6e2d1893f288214413c4b97273980f3aa4a Mon Sep 17 00:00:00 2001 From: Santiago Aboy Solanes Date: Fri, 8 Dec 2023 14:01:44 +0000 Subject: Revert "Disable write-barrier elimination pass" This reverts commit 5a3271d7caafefd10a20f5a5db09d2c178838b76. Reason for revert: This CL has two fixes (codegen not doing a null check if a write barrier is being relied on, and codegen not recomputing skipping write barriers), regression tests, a new runtime check which runs in debug mode for the CC GC to ensure that the card table is set correctly for skipped write barriers, and new compile time (graph checker) tests to ensure graph consistency. This patchset updates the WriteBarrierKind to be {emit being relied on, emit not being relied on, dont emit}, which leaves the null check skip implementation to codegen. Test 2247- is removed from knownfailures.json but still skipped in MTS due to SLO requirements. Test: art/test/testrunner/testrunner.py --host --64 --optimizing -b Bug: 301833859 Bug: 310755375 Bug: 260843353 Change-Id: I025597e284b2765986e2091538680ee629fb5ae7 --- compiler/optimizing/code_generator.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'compiler/optimizing/code_generator.h') diff --git a/compiler/optimizing/code_generator.h b/compiler/optimizing/code_generator.h index de6fc85da4..0e26a501da 100644 --- a/compiler/optimizing/code_generator.h +++ b/compiler/optimizing/code_generator.h @@ -380,6 +380,11 @@ class CodeGenerator : public DeletableArenaObject { bool EmitNonBakerReadBarrier() const; ReadBarrierOption GetCompilerReadBarrierOption() const; + // Returns true if we should check the GC card for consistency purposes. + bool ShouldCheckGCCard(DataType::Type type, + HInstruction* value, + WriteBarrierKind write_barrier_kind) const; + // Get the ScopedArenaAllocator used for codegen memory allocation. ScopedArenaAllocator* GetScopedAllocator(); @@ -503,6 +508,11 @@ class CodeGenerator : public DeletableArenaObject { return type == DataType::Type::kReference && !value->IsNullConstant(); } + // If we are compiling a graph with the WBE pass enabled, we want to honor the WriteBarrierKind + // set during the WBE pass. + bool StoreNeedsWriteBarrier(DataType::Type type, + HInstruction* value, + WriteBarrierKind write_barrier_kind) const; // Performs checks pertaining to an InvokeRuntime call. void ValidateInvokeRuntime(QuickEntrypointEnum entrypoint, -- cgit v1.2.3-59-g8ed1b