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

Side by Side Diff: src/hydrogen-canonicalize.cc

Issue 22600005: Eliminate intentional conversion from Smi to Int32 in HMul (Closed) Base URL: https://github.com/v8/v8.git@master
Patch Set: Fixed navier stokes benchmark fails Created 7 years, 4 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 unified diff | Download patch
« no previous file with comments | « src/arm/lithium-codegen-arm.cc ('k') | src/hydrogen-infer-representation.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 30 matching lines...) Expand all
41 if (instr->IsArithmeticBinaryOperation()) { 41 if (instr->IsArithmeticBinaryOperation()) {
42 if (instr->representation().IsInteger32()) { 42 if (instr->representation().IsInteger32()) {
43 if (instr->HasAtLeastOneUseWithFlagAndNoneWithout( 43 if (instr->HasAtLeastOneUseWithFlagAndNoneWithout(
44 HInstruction::kTruncatingToInt32)) { 44 HInstruction::kTruncatingToInt32)) {
45 instr->SetFlag(HInstruction::kAllUsesTruncatingToInt32); 45 instr->SetFlag(HInstruction::kAllUsesTruncatingToInt32);
46 } 46 }
47 } else if (instr->representation().IsSmi()) { 47 } else if (instr->representation().IsSmi()) {
48 if (instr->HasAtLeastOneUseWithFlagAndNoneWithout( 48 if (instr->HasAtLeastOneUseWithFlagAndNoneWithout(
49 HInstruction::kTruncatingToSmi)) { 49 HInstruction::kTruncatingToSmi)) {
50 instr->SetFlag(HInstruction::kAllUsesTruncatingToSmi); 50 instr->SetFlag(HInstruction::kAllUsesTruncatingToSmi);
51 } else if (instr->HasAtLeastOneUseWithFlagAndNoneWithout(
52 HInstruction::kTruncatingToInt32)) {
53 // Avoid redundant minus zero check
54 instr->SetFlag(HInstruction::kAllUsesTruncatingToInt32);
51 } 55 }
52 } 56 }
53 } 57 }
54 } 58 }
55 } 59 }
56 // Perform actual Canonicalization pass. 60 // Perform actual Canonicalization pass.
57 for (int i = 0; i < blocks->length(); ++i) { 61 for (int i = 0; i < blocks->length(); ++i) {
58 for (HInstructionIterator it(blocks->at(i)); !it.Done(); it.Advance()) { 62 for (HInstructionIterator it(blocks->at(i)); !it.Done(); it.Advance()) {
59 HInstruction* instr = it.Current(); 63 HInstruction* instr = it.Current();
60 HValue* value = instr->Canonicalize(); 64 HValue* value = instr->Canonicalize();
61 if (value != instr) instr->DeleteAndReplaceWith(value); 65 if (value != instr) instr->DeleteAndReplaceWith(value);
62 } 66 }
63 } 67 }
64 } 68 }
65 69
66 } } // namespace v8::internal 70 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/arm/lithium-codegen-arm.cc ('k') | src/hydrogen-infer-representation.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698