Commit e05dbf4e authored by bmeurer@chromium.org's avatar bmeurer@chromium.org

Drop unused accumulated first time changes/depends.

R=svenpanne@chromium.org

Review URL: https://codereview.chromium.org/135503004

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@19213 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent ff1c294c
...@@ -535,13 +535,9 @@ void HGlobalValueNumberingPhase::LoopInvariantCodeMotion() { ...@@ -535,13 +535,9 @@ void HGlobalValueNumberingPhase::LoopInvariantCodeMotion() {
block->block_id(), block->block_id(),
GetGVNFlagsString(side_effects).get()); GetGVNFlagsString(side_effects).get());
GVNFlagSet accumulated_first_time_depends;
GVNFlagSet accumulated_first_time_changes;
HBasicBlock* last = block->loop_information()->GetLastBackEdge(); HBasicBlock* last = block->loop_information()->GetLastBackEdge();
for (int j = block->block_id(); j <= last->block_id(); ++j) { for (int j = block->block_id(); j <= last->block_id(); ++j) {
ProcessLoopBlock(graph()->blocks()->at(j), block, side_effects, ProcessLoopBlock(graph()->blocks()->at(j), block, side_effects);
&accumulated_first_time_depends,
&accumulated_first_time_changes);
} }
} }
} }
...@@ -551,9 +547,7 @@ void HGlobalValueNumberingPhase::LoopInvariantCodeMotion() { ...@@ -551,9 +547,7 @@ void HGlobalValueNumberingPhase::LoopInvariantCodeMotion() {
void HGlobalValueNumberingPhase::ProcessLoopBlock( void HGlobalValueNumberingPhase::ProcessLoopBlock(
HBasicBlock* block, HBasicBlock* block,
HBasicBlock* loop_header, HBasicBlock* loop_header,
GVNFlagSet loop_kills, GVNFlagSet loop_kills) {
GVNFlagSet* first_time_depends,
GVNFlagSet* first_time_changes) {
HBasicBlock* pre_header = loop_header->predecessors()->at(0); HBasicBlock* pre_header = loop_header->predecessors()->at(0);
GVNFlagSet depends_flags = HValue::ConvertChangesToDependsFlags(loop_kills); GVNFlagSet depends_flags = HValue::ConvertChangesToDependsFlags(loop_kills);
TRACE_GVN_2("Loop invariant motion for B%d %s\n", TRACE_GVN_2("Loop invariant motion for B%d %s\n",
...@@ -562,7 +556,6 @@ void HGlobalValueNumberingPhase::ProcessLoopBlock( ...@@ -562,7 +556,6 @@ void HGlobalValueNumberingPhase::ProcessLoopBlock(
HInstruction* instr = block->first(); HInstruction* instr = block->first();
while (instr != NULL) { while (instr != NULL) {
HInstruction* next = instr->next(); HInstruction* next = instr->next();
bool hoisted = false;
if (instr->CheckFlag(HValue::kUseGVN)) { if (instr->CheckFlag(HValue::kUseGVN)) {
TRACE_GVN_4("Checking instruction %d (%s) %s. Loop %s\n", TRACE_GVN_4("Checking instruction %d (%s) %s. Loop %s\n",
instr->id(), instr->id(),
...@@ -589,26 +582,9 @@ void HGlobalValueNumberingPhase::ProcessLoopBlock( ...@@ -589,26 +582,9 @@ void HGlobalValueNumberingPhase::ProcessLoopBlock(
instr->Unlink(); instr->Unlink();
instr->InsertBefore(pre_header->end()); instr->InsertBefore(pre_header->end());
if (instr->HasSideEffects()) removed_side_effects_ = true; if (instr->HasSideEffects()) removed_side_effects_ = true;
hoisted = true;
} }
} }
} }
if (!hoisted) {
// If an instruction is not hoisted, we have to account for its side
// effects when hoisting later HTransitionElementsKind instructions.
GVNFlagSet previous_depends = *first_time_depends;
GVNFlagSet previous_changes = *first_time_changes;
first_time_depends->Add(instr->DependsOnFlags());
first_time_changes->Add(instr->ChangesFlags());
if (!(previous_depends == *first_time_depends)) {
TRACE_GVN_1("Updated first-time accumulated %s\n",
GetGVNFlagsString(*first_time_depends).get());
}
if (!(previous_changes == *first_time_changes)) {
TRACE_GVN_1("Updated first-time accumulated %s\n",
GetGVNFlagsString(*first_time_changes).get());
}
}
instr = next; instr = next;
} }
} }
......
...@@ -52,9 +52,7 @@ class HGlobalValueNumberingPhase : public HPhase { ...@@ -52,9 +52,7 @@ class HGlobalValueNumberingPhase : public HPhase {
void LoopInvariantCodeMotion(); void LoopInvariantCodeMotion();
void ProcessLoopBlock(HBasicBlock* block, void ProcessLoopBlock(HBasicBlock* block,
HBasicBlock* before_loop, HBasicBlock* before_loop,
GVNFlagSet loop_kills, GVNFlagSet loop_kills);
GVNFlagSet* accumulated_first_time_depends,
GVNFlagSet* accumulated_first_time_changes);
bool AllowCodeMotion(); bool AllowCodeMotion();
bool ShouldMove(HInstruction* instr, HBasicBlock* loop_header); bool ShouldMove(HInstruction* instr, HBasicBlock* loop_header);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment