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

Unified Diff: runtime/vm/intermediate_language.h

Issue 13469013: Use range analysis to improve constant propagation. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: addressed comments Created 7 years, 9 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_optimizer.cc ('k') | runtime/vm/intermediate_language.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intermediate_language.h
===================================================================
--- runtime/vm/intermediate_language.h (revision 20842)
+++ runtime/vm/intermediate_language.h (working copy)
@@ -1825,6 +1825,14 @@
return constrained_type_;
}
+ void set_constant_target(TargetEntryInstr* target) {
+ ASSERT(target == true_successor() || target == false_successor());
+ constant_target_ = target;
+ }
+ TargetEntryInstr* constant_target() const {
+ return constant_target_;
+ }
+
private:
virtual void RawSetInputAt(intptr_t i, Value* value);
@@ -1833,6 +1841,8 @@
ConstrainedCompileType* constrained_type_;
+ TargetEntryInstr* constant_target_;
+
DISALLOW_COPY_AND_ASSIGN(BranchInstr);
};
@@ -2029,12 +2039,12 @@
return min_.Equals(other->min_) && max_.Equals(other->max_);
}
- static RangeBoundary ConstantMin(Range* range) {
+ static RangeBoundary ConstantMin(const Range* range) {
if (range == NULL) return RangeBoundary::MinSmi();
return range->min().LowerBound().Clamp();
}
- static RangeBoundary ConstantMax(Range* range) {
+ static RangeBoundary ConstantMax(const Range* range) {
if (range == NULL) return RangeBoundary::MaxSmi();
return range->max().UpperBound().Clamp();
}
@@ -2042,6 +2052,8 @@
// Inclusive.
bool IsWithin(intptr_t min_int, intptr_t max_int) const;
+ bool IsUnsatisfiable() const;
+
private:
RangeBoundary min_;
RangeBoundary max_;
@@ -2051,7 +2063,8 @@
class ConstraintInstr : public TemplateDefinition<2> {
public:
ConstraintInstr(Value* value, Range* constraint)
- : constraint_(constraint) {
+ : constraint_(constraint),
+ target_(NULL) {
SetInputAt(0, value);
}
@@ -2085,12 +2098,23 @@
SetInputAt(1, val);
}
+ // Constraints for branches have their target block stored in order
+ // to find the the comparsion that generated the constraint:
+ // target->predecessor->last_instruction->comparison.
+ void set_target(TargetEntryInstr* target) {
+ target_ = target;
+ }
+ TargetEntryInstr* target() const {
+ return target_;
+ }
+
private:
Value* dependency() {
return inputs_[1];
}
Range* constraint_;
+ TargetEntryInstr* target_;
DISALLOW_COPY_AND_ASSIGN(ConstraintInstr);
};
« no previous file with comments | « runtime/vm/flow_graph_optimizer.cc ('k') | runtime/vm/intermediate_language.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698