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

Unified Diff: src/hydrogen-instructions.cc

Issue 14320021: Ignore observed Double output in binary operations when all uses are truncating to Integer32 (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: cleanup Created 7 years, 8 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/hydrogen-instructions.cc
diff --git a/src/hydrogen-instructions.cc b/src/hydrogen-instructions.cc
index 6496fa8eeb9d96bd3e9e0e0a7827ce41619377fa..f2dc33038024e900318782ef9ef97010ede21722 100644
--- a/src/hydrogen-instructions.cc
+++ b/src/hydrogen-instructions.cc
@@ -2232,9 +2232,6 @@ Representation HBinaryOperation::RepresentationFromInputs() {
// Determine the worst case of observed input representations and
// the currently assumed output representation.
Representation rep = representation();
- if (observed_output_representation_.is_more_general_than(rep)) {
- rep = observed_output_representation_;
- }
for (int i = 1; i <= 2; ++i) {
Representation input_rep = observed_input_representation(i);
if (input_rep.is_more_general_than(rep)) rep = input_rep;
@@ -2252,6 +2249,21 @@ Representation HBinaryOperation::RepresentationFromInputs() {
right()->CheckFlag(kFlexibleRepresentation)) {
rep = right_rep;
}
+ // Consider observed output representation, but ignore it if it's Double,
+ // this instruction is not a division, and all its uses are truncating
+ // to Integer32.
+ if (observed_output_representation_.is_more_general_than(rep)) {
Sven Panne 2013/04/22 13:52:29 Simplifying this a bit and extracting a predicate
Jakob Kummerow 2013/04/22 15:24:41 Done.
+ bool ignore = false;
+ if (observed_output_representation_.IsDouble() &&
+ rep.IsInteger32() &&
+ // TODO(jkummerow): remove the Div blacklisting when the Div
+ // instruction has learned not to deopt when the remainder is
+ // non-zero but all uses are truncating.
+ !this->IsDiv()) {
+ ignore = CheckUsesForFlag(kTruncatingToInt32);
+ }
+ if (!ignore) rep = observed_output_representation_;
+ }
return rep;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698