summaryrefslogtreecommitdiff
path: root/compiler/optimizing/optimizing_unit_test.h
diff options
context:
space:
mode:
author Vladimír Marko <vmarko@google.com> 2024-10-04 09:18:58 +0000
committer Vladimír Marko <vmarko@google.com> 2024-10-07 07:00:16 +0000
commitc50d67991682a9ae5e6215031a9852bbf018504b (patch)
treea9b685384873c864fe333fac743d40085ecc8e18 /compiler/optimizing/optimizing_unit_test.h
parent00db5b25da2d2ff8005476c7c735eb4f921d3a56 (diff)
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
Diffstat (limited to 'compiler/optimizing/optimizing_unit_test.h')
-rw-r--r--compiler/optimizing/optimizing_unit_test.h4
1 files changed, 4 insertions, 0 deletions
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<HInstruction*> 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,