Commit 902f264a authored by bmeurer's avatar bmeurer Committed by Commit bot

[turbofan] Teach ad-hoc load elimination about atomic regions.

The LoadElimination in TurboFan can look into the atomic regions and
elimination subsequent loads based on stores/allocations in that atomic
regions.

R=jarin@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#32179}
parent 3b341344
......@@ -28,7 +28,7 @@ Reduction LoadElimination::Reduce(Node* node) {
Reduction LoadElimination::ReduceLoadField(Node* node) {
DCHECK_EQ(IrOpcode::kLoadField, node->opcode());
FieldAccess const access = FieldAccessOf(node->op());
Node* const object = NodeProperties::GetValueInput(node, 0);
Node* object = NodeProperties::GetValueInput(node, 0);
for (Node* effect = NodeProperties::GetEffectInput(node);;
effect = NodeProperties::GetEffectInput(effect)) {
switch (effect->opcode()) {
......@@ -53,11 +53,24 @@ Reduction LoadElimination::ReduceLoadField(Node* node) {
}
break;
}
case IrOpcode::kBeginRegion:
case IrOpcode::kStoreBuffer:
case IrOpcode::kStoreElement: {
// These can never interfere with field loads.
break;
}
case IrOpcode::kFinishRegion: {
// "Look through" FinishRegion nodes to make LoadElimination capable
// of looking into atomic regions.
if (object == effect) object = NodeProperties::GetValueInput(effect, 0);
break;
}
case IrOpcode::kAllocate: {
// Allocations don't interfere with field loads. In case we see the
// actual allocation for the {object} we can abort.
if (object == effect) return NoChange();
break;
}
default: {
if (!effect->op()->HasProperty(Operator::kNoWrite) ||
effect->op()->EffectInputCount() != 1) {
......
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