Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(701)

Unified Diff: runtime/vm/flow_graph_optimizer.cc

Issue 1377113004: VM: Support phis with pair representations. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: rebased Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/flow_graph_builder.cc ('k') | runtime/vm/il_printer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_optimizer.cc
diff --git a/runtime/vm/flow_graph_optimizer.cc b/runtime/vm/flow_graph_optimizer.cc
index 9de736b7795a880382e445ef12d624b5a4685a0f..08b2ef0c1ba0e73d2787e5fcae2fed06981f2ff5 100644
--- a/runtime/vm/flow_graph_optimizer.cc
+++ b/runtime/vm/flow_graph_optimizer.cc
@@ -626,7 +626,7 @@ static void EnsureSSATempIndex(FlowGraph* graph,
Definition* replacement) {
if ((replacement->ssa_temp_index() == -1) &&
(defn->ssa_temp_index() != -1)) {
- replacement->set_ssa_temp_index(graph->alloc_ssa_temp_index());
+ graph->AllocateSSAIndexes(replacement);
}
}
@@ -838,10 +838,10 @@ static void UnboxPhi(PhiInstr* phi) {
if ((kSmiBits < 32) &&
(unboxed == kTagged) &&
phi->Type()->IsInt() &&
- RangeUtils::Fits(phi->range(), RangeBoundary::kRangeBoundaryInt32)) {
+ RangeUtils::Fits(phi->range(), RangeBoundary::kRangeBoundaryInt64)) {
// On 32-bit platforms conservatively unbox phis that:
// - are proven to be of type Int;
- // - fit into 32bits range;
+ // - fit into 64bits range;
// - have either constants or Box() operations as inputs;
// - have at least one Box() operation as an input;
// - are used in at least 1 Unbox() operation.
@@ -850,7 +850,7 @@ static void UnboxPhi(PhiInstr* phi) {
Definition* input = phi->InputAt(i)->definition();
if (input->IsBox() &&
RangeUtils::Fits(input->range(),
- RangeBoundary::kRangeBoundaryInt32)) {
+ RangeBoundary::kRangeBoundaryInt64)) {
should_unbox = true;
} else if (!input->IsConstant()) {
should_unbox = false;
@@ -882,7 +882,9 @@ static void UnboxPhi(PhiInstr* phi) {
}
if (should_unbox) {
- unboxed = kUnboxedInt32;
+ unboxed =
+ RangeUtils::Fits(phi->range(), RangeBoundary::kRangeBoundaryInt32)
+ ? kUnboxedInt32 : kUnboxedMint;
}
}
@@ -7073,7 +7075,7 @@ class LoadOptimizer : public ValueObject {
replacement->AddInputUse(input);
}
- phi->set_ssa_temp_index(graph_->alloc_ssa_temp_index());
+ graph_->AllocateSSAIndexes(phi);
phis_.Add(phi); // Postpone phi insertion until after load forwarding.
if (FLAG_trace_load_optimization) {
« no previous file with comments | « runtime/vm/flow_graph_builder.cc ('k') | runtime/vm/il_printer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698