Skip to content

Commit 11c2c4a

Browse files
rmacnak-googlecommit-bot@chromium.org
authored andcommitted
[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>
1 parent db8d71d commit 11c2c4a

File tree

4 files changed

+5
-11
lines changed

4 files changed

+5
-11
lines changed

runtime/vm/compiler/backend/flow_graph.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1809,6 +1809,7 @@ void FlowGraph::InsertConversion(Representation from,
18091809
Representation to,
18101810
Value* use,
18111811
bool is_environment_use) {
1812+
ASSERT(from != to);
18121813
Instruction* insert_before;
18131814
Instruction* deopt_target;
18141815
PhiInstr* phi = use->instruction()->AsPhi();

runtime/vm/compiler/backend/il.cc

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3288,12 +3288,9 @@ Definition* UnboxInt64Instr::Canonicalize(FlowGraph* flow_graph) {
32883288
return replacement;
32893289
}
32903290

3291-
// Currently we perform this only on 64-bit architectures.
3292-
if (compiler::target::kBitsPerWord == 64) {
3293-
ConstantInstr* c = value()->definition()->AsConstant();
3294-
if (c != NULL && c->value().IsInteger()) {
3295-
return flow_graph->GetConstant(c->value(), kUnboxedInt64);
3296-
}
3291+
ConstantInstr* c = value()->definition()->AsConstant();
3292+
if (c != NULL && c->value().IsInteger()) {
3293+
return flow_graph->GetConstant(c->value(), kUnboxedInt64);
32973294
}
32983295

32993296
return this;

runtime/vm/compiler/backend/il.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6475,6 +6475,7 @@ class StoreUntaggedInstr : public TemplateInstruction<2, NoThrow> {
64756475
Value* value() const { return inputs_[1]; }
64766476
intptr_t offset() const { return offset_; }
64776477

6478+
virtual intptr_t DeoptimizationTarget() const { return GetDeoptId(); }
64786479
virtual bool ComputeCanDeoptimize() const { return false; }
64796480
virtual bool HasUnknownSideEffects() const { return false; }
64806481
virtual bool AttributesEqual(const Instruction& other) const {

runtime/vm/compiler/backend/inliner_test.cc

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -220,11 +220,6 @@ ISOLATE_UNIT_TEST_CASE(Inliner_List_generate) {
220220
kMoveGlob,
221221
kMatchAndMoveCreateArray,
222222
kMatchAndMoveUnboxInt64,
223-
#if defined(TARGET_ARCH_IS_32_BIT)
224-
// TODO(rmacnak): Implement missing ops to allow 32-bit architectures in
225-
// UnboxInt64Instr::Canonicalize.
226-
kMatchAndMoveUnboxInt64,
227-
#endif
228223
kMatchAndMoveGoto,
229224

230225
// Loop header

0 commit comments

Comments
 (0)