[vm, compiler] Allow further folding of UnboxInt64(Constant) to UnboxedConstant.
TEST=ci
Change-Id: I3a55a007d4b8510faa33593698554f7e9bf982e2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196225
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
diff --git a/runtime/vm/compiler/backend/flow_graph.cc b/runtime/vm/compiler/backend/flow_graph.cc
index c593d17..27bc58a 100644
--- a/runtime/vm/compiler/backend/flow_graph.cc
+++ b/runtime/vm/compiler/backend/flow_graph.cc
@@ -1809,6 +1809,7 @@
Representation to,
Value* use,
bool is_environment_use) {
+ ASSERT(from != to);
Instruction* insert_before;
Instruction* deopt_target;
PhiInstr* phi = use->instruction()->AsPhi();
diff --git a/runtime/vm/compiler/backend/il.cc b/runtime/vm/compiler/backend/il.cc
index 3e59fa6..834bc87 100644
--- a/runtime/vm/compiler/backend/il.cc
+++ b/runtime/vm/compiler/backend/il.cc
@@ -3288,12 +3288,9 @@
return replacement;
}
- // Currently we perform this only on 64-bit architectures.
- if (compiler::target::kBitsPerWord == 64) {
- ConstantInstr* c = value()->definition()->AsConstant();
- if (c != NULL && c->value().IsInteger()) {
- return flow_graph->GetConstant(c->value(), kUnboxedInt64);
- }
+ ConstantInstr* c = value()->definition()->AsConstant();
+ if (c != NULL && c->value().IsInteger()) {
+ return flow_graph->GetConstant(c->value(), kUnboxedInt64);
}
return this;
diff --git a/runtime/vm/compiler/backend/il.h b/runtime/vm/compiler/backend/il.h
index 22326fb..46a5d13 100644
--- a/runtime/vm/compiler/backend/il.h
+++ b/runtime/vm/compiler/backend/il.h
@@ -6475,6 +6475,7 @@
Value* value() const { return inputs_[1]; }
intptr_t offset() const { return offset_; }
+ virtual intptr_t DeoptimizationTarget() const { return GetDeoptId(); }
virtual bool ComputeCanDeoptimize() const { return false; }
virtual bool HasUnknownSideEffects() const { return false; }
virtual bool AttributesEqual(const Instruction& other) const {
diff --git a/runtime/vm/compiler/backend/inliner_test.cc b/runtime/vm/compiler/backend/inliner_test.cc
index cf772e4..f5c59aa 100644
--- a/runtime/vm/compiler/backend/inliner_test.cc
+++ b/runtime/vm/compiler/backend/inliner_test.cc
@@ -220,11 +220,6 @@
kMoveGlob,
kMatchAndMoveCreateArray,
kMatchAndMoveUnboxInt64,
-#if defined(TARGET_ARCH_IS_32_BIT)
- // TODO(rmacnak): Implement missing ops to allow 32-bit architectures in
- // UnboxInt64Instr::Canonicalize.
- kMatchAndMoveUnboxInt64,
-#endif
kMatchAndMoveGoto,
// Loop header