Commit d40195e4 authored by bradnelson's avatar bradnelson Committed by Commit bot

Revert "[ia32] Optimize index calculation for certain checked load/stores."

This reverts commit 5c1babcc.

This seems to regress a range of benchmarks on ia32:
  Emscripten for Fannkuch, Zlib, MemOps, Life, Bullet
  AreWeFastYet for BulletLoadTime, Fasta, Fannkuch
  JetStream for towers.c, quicksort.c, gcc-loops.cpp, bigfib.cpp

BUG=673861
R=jarin@chromium.org,shiyu.zhang@intel.com

Review-Url: https://codereview.chromium.org/2573983003
Cr-Commit-Position: refs/heads/master@{#41696}
parent 21255208
This diff is collapsed.
...@@ -395,25 +395,18 @@ void InstructionSelector::VisitCheckedLoad(Node* node) { ...@@ -395,25 +395,18 @@ void InstructionSelector::VisitCheckedLoad(Node* node) {
UNREACHABLE(); UNREACHABLE();
return; return;
} }
Int32Matcher mbuffer(buffer); InstructionOperand offset_operand = g.UseRegister(offset);
InstructionOperand buffer_operand =
mbuffer.HasValue() ? g.UseImmediate(buffer) : g.UseRegister(buffer);
if (offset->opcode() == IrOpcode::kInt32Add && CanCover(node, offset)) {
Int32Matcher mlength(length);
Int32BinopMatcher moffset(offset);
if (mlength.HasValue() && moffset.right().HasValue() &&
moffset.right().Value() > 0 &&
mlength.Value() >= moffset.right().Value()) {
Emit(opcode, g.DefineAsRegister(node), buffer_operand,
g.UseRegister(moffset.left().node()),
g.UseImmediate(moffset.right().node()), g.UseImmediate(length));
return;
}
}
InstructionOperand length_operand = InstructionOperand length_operand =
g.CanBeImmediate(length) ? g.UseImmediate(length) : g.UseRegister(length); g.CanBeImmediate(length) ? g.UseImmediate(length) : g.UseRegister(length);
Emit(opcode, g.DefineAsRegister(node), buffer_operand, g.UseRegister(offset), if (g.CanBeImmediate(buffer)) {
g.TempImmediate(0), length_operand); Emit(opcode | AddressingModeField::encode(kMode_MRI),
g.DefineAsRegister(node), offset_operand, length_operand,
offset_operand, g.UseImmediate(buffer));
} else {
Emit(opcode | AddressingModeField::encode(kMode_MR1),
g.DefineAsRegister(node), offset_operand, length_operand,
g.UseRegister(buffer), offset_operand);
}
} }
...@@ -457,26 +450,18 @@ void InstructionSelector::VisitCheckedStore(Node* node) { ...@@ -457,26 +450,18 @@ void InstructionSelector::VisitCheckedStore(Node* node) {
rep == MachineRepresentation::kBit) rep == MachineRepresentation::kBit)
? g.UseByteRegister(value) ? g.UseByteRegister(value)
: g.UseRegister(value)); : g.UseRegister(value));
Int32Matcher mbuffer(buffer); InstructionOperand offset_operand = g.UseRegister(offset);
InstructionOperand buffer_operand =
mbuffer.HasValue() ? g.UseImmediate(buffer) : g.UseRegister(buffer);
if (offset->opcode() == IrOpcode::kInt32Add && CanCover(node, offset)) {
Int32Matcher mlength(length);
Int32BinopMatcher moffset(offset);
if (mlength.HasValue() && moffset.right().HasValue() &&
moffset.right().Value() > 0 &&
mlength.Value() >= moffset.right().Value()) {
Emit(opcode, g.NoOutput(), buffer_operand,
g.UseRegister(moffset.left().node()),
g.UseImmediate(moffset.right().node()), g.UseImmediate(length),
value_operand);
return;
}
}
InstructionOperand length_operand = InstructionOperand length_operand =
g.CanBeImmediate(length) ? g.UseImmediate(length) : g.UseRegister(length); g.CanBeImmediate(length) ? g.UseImmediate(length) : g.UseRegister(length);
Emit(opcode, g.NoOutput(), buffer_operand, g.UseRegister(offset), if (g.CanBeImmediate(buffer)) {
g.TempImmediate(0), length_operand, value_operand); Emit(opcode | AddressingModeField::encode(kMode_MRI), g.NoOutput(),
offset_operand, length_operand, value_operand, offset_operand,
g.UseImmediate(buffer));
} else {
Emit(opcode | AddressingModeField::encode(kMode_MR1), g.NoOutput(),
offset_operand, length_operand, value_operand, g.UseRegister(buffer),
offset_operand);
}
} }
namespace { namespace {
......
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