From c50d67991682a9ae5e6215031a9852bbf018504b Mon Sep 17 00:00:00 2001 From: VladimĂ­r Marko Date: Fri, 4 Oct 2024 09:18:58 +0000 Subject: Reland "Calculate the number of out vregs." This reverts commit 434a327234f74eed3ef4072314d2e2bdb73e4dda. Reason for revert: Relanding with no change. The regressions that were the reason for the revert may reappear. However, these regressions are probably caused by subtle effects that are not directly related to this change. For example, a code size improvement can regress performance simply by moving the start of a loop from an aligned address to an unaligned address, or by splitting a loop across two cache lines. Bug: 358519867 Bug: 359722268 Change-Id: I997b8a4219418f79b3a5fc4e7e50817911f0a737 --- compiler/optimizing/optimizing_unit_test.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'compiler/optimizing/optimizing_unit_test.h') diff --git a/compiler/optimizing/optimizing_unit_test.h b/compiler/optimizing/optimizing_unit_test.h index 6d451663e5..34eed29116 100644 --- a/compiler/optimizing/optimizing_unit_test.h +++ b/compiler/optimizing/optimizing_unit_test.h @@ -647,9 +647,13 @@ class OptimizingUnitTestHelper { std::initializer_list env = {}, uint32_t dex_pc = kNoDexPc) { MethodReference method_reference{/* file= */ &graph_->GetDexFile(), /* index= */ method_idx_++}; + size_t num_64bit_args = std::count_if(args.begin(), args.end(), [](HInstruction* insn) { + return DataType::Is64BitType(insn->GetType()); + }); HInvokeStaticOrDirect* invoke = new (GetAllocator()) HInvokeStaticOrDirect(GetAllocator(), args.size(), + /* number_of_out_vregs= */ args.size() + num_64bit_args, return_type, dex_pc, method_reference, -- cgit v1.2.3-59-g8ed1b