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

Unified Diff: src/hydrogen-canonicalize.cc

Issue 1405363003: Move Hydrogen and Lithium to src/crankshaft/ (Closed) Base URL: https://chromium.googlesource.com/v8/v8.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 | « src/hydrogen-canonicalize.h ('k') | src/hydrogen-check-elimination.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/hydrogen-canonicalize.cc
diff --git a/src/hydrogen-canonicalize.cc b/src/hydrogen-canonicalize.cc
deleted file mode 100644
index 25911eb353ae7e1326546e1682af412ce1e9026a..0000000000000000000000000000000000000000
--- a/src/hydrogen-canonicalize.cc
+++ /dev/null
@@ -1,56 +0,0 @@
-// Copyright 2013 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "src/hydrogen-canonicalize.h"
-#include "src/hydrogen-redundant-phi.h"
-
-namespace v8 {
-namespace internal {
-
-void HCanonicalizePhase::Run() {
- const ZoneList<HBasicBlock*>* blocks(graph()->blocks());
- // Before removing no-op instructions, save their semantic value.
- // We must be careful not to set the flag unnecessarily, because GVN
- // cannot identify two instructions when their flag value differs.
- for (int i = 0; i < blocks->length(); ++i) {
- for (HInstructionIterator it(blocks->at(i)); !it.Done(); it.Advance()) {
- HInstruction* instr = it.Current();
- if (instr->IsArithmeticBinaryOperation()) {
- if (instr->representation().IsInteger32()) {
- if (instr->HasAtLeastOneUseWithFlagAndNoneWithout(
- HInstruction::kTruncatingToInt32)) {
- instr->SetFlag(HInstruction::kAllUsesTruncatingToInt32);
- }
- } else if (instr->representation().IsSmi()) {
- if (instr->HasAtLeastOneUseWithFlagAndNoneWithout(
- HInstruction::kTruncatingToSmi)) {
- instr->SetFlag(HInstruction::kAllUsesTruncatingToSmi);
- } else if (instr->HasAtLeastOneUseWithFlagAndNoneWithout(
- HInstruction::kTruncatingToInt32)) {
- // Avoid redundant minus zero check
- instr->SetFlag(HInstruction::kAllUsesTruncatingToInt32);
- }
- }
- }
- }
- }
-
- // Perform actual Canonicalization pass.
- HRedundantPhiEliminationPhase redundant_phi_eliminator(graph());
- for (int i = 0; i < blocks->length(); ++i) {
- // Eliminate redundant phis in the block first; changes to their inputs
- // might have made them redundant, and eliminating them creates more
- // opportunities for constant folding and strength reduction.
- redundant_phi_eliminator.ProcessBlock(blocks->at(i));
- // Now canonicalize each instruction.
- for (HInstructionIterator it(blocks->at(i)); !it.Done(); it.Advance()) {
- HInstruction* instr = it.Current();
- HValue* value = instr->Canonicalize();
- if (value != instr) instr->DeleteAndReplaceWith(value);
- }
- }
-}
-
-} // namespace internal
-} // namespace v8
« no previous file with comments | « src/hydrogen-canonicalize.h ('k') | src/hydrogen-check-elimination.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698