From 2ff30ee836f17f65d3cb678d098699a6b514cbc6 Mon Sep 17 00:00:00 2001 From: Ryan Macnak Date: Tue, 9 Jan 2024 20:44:38 +0000 Subject: [PATCH] [vm] Don't create UnboxedConstantInstr(kUnboxedInt64) for RISCV32. TEST=dartfuzz Bug: https://github.com/dart-lang/sdk/issues/54425 Bug: https://github.com/dart-lang/sdk/issues/54434 Change-Id: I05975376cd61ffeceda60edf76df182fbf753593 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345348 Commit-Queue: Ryan Macnak Reviewed-by: Alexander Markov --- runtime/vm/compiler/aot/aot_call_specializer.cc | 2 +- runtime/vm/compiler/backend/il_riscv.cc | 2 ++ utils/dartdev/BUILD.gn | 6 ++---- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/runtime/vm/compiler/aot/aot_call_specializer.cc b/runtime/vm/compiler/aot/aot_call_specializer.cc index 2ced8c6c00b..346fd28ba30 100644 --- a/runtime/vm/compiler/aot/aot_call_specializer.cc +++ b/runtime/vm/compiler/aot/aot_call_specializer.cc @@ -402,7 +402,7 @@ Definition* AotCallSpecializer::TryOptimizeDivisionOperation( Value* right_value) { auto unboxed_constant = [&](int64_t value) -> Definition* { ASSERT(compiler::target::IsSmi(value)); -#if defined(TARGET_ARCH_ARM) +#if defined(TARGET_ARCH_IS_32_BIT) Definition* const const_def = new (Z) UnboxedConstantInstr( Smi::ZoneHandle(Z, Smi::New(value)), kUnboxedInt32); InsertBefore(instr, const_def, /*env=*/nullptr, FlowGraph::kValue); diff --git a/runtime/vm/compiler/backend/il_riscv.cc b/runtime/vm/compiler/backend/il_riscv.cc index 3e065fe2e24..ff8856db2a0 100644 --- a/runtime/vm/compiler/backend/il_riscv.cc +++ b/runtime/vm/compiler/backend/il_riscv.cc @@ -44,6 +44,8 @@ LocationSummary* Instruction::MakeCallSummary(Zone* zone, const auto representation = instr->representation(); switch (representation) { case kTagged: + case kUnboxedUint32: + case kUnboxedInt32: result->set_out( 0, Location::RegisterLocation(CallingConventions::kReturnReg)); break; diff --git a/utils/dartdev/BUILD.gn b/utils/dartdev/BUILD.gn index 8a0adf0b058..ad9756b2a8f 100644 --- a/utils/dartdev/BUILD.gn +++ b/utils/dartdev/BUILD.gn @@ -25,13 +25,11 @@ application_snapshot("generate_dartdev_snapshot") { deps = [ "../dds:dds", - "../dtd:dtd" + "../dtd:dtd", ] # DDS should be run from AOT snapshot on all architectures except IA32/X86. - # TODO(https://dartbug.com/54434): Fix simriscv32 AOT. - if (dart_target_arch != "ia32" && dart_target_arch != "x86" && - dart_target_arch != "riscv32") { + if (dart_target_arch != "ia32" && dart_target_arch != "x86") { deps += [ "../dds:dds_aot" ] }