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

Unified Diff: src/compiler/load-elimination.cc

Issue 1472703005: [turbofan] Teach ad-hoc load elimination about atomic regions. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 1 month 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/load-elimination.cc
diff --git a/src/compiler/load-elimination.cc b/src/compiler/load-elimination.cc
index c78a283ca097847202e1b66ff79c62723ffbb133..97f1ab0ec548c7aae48c7b75071f39abff3613e6 100644
--- a/src/compiler/load-elimination.cc
+++ b/src/compiler/load-elimination.cc
@@ -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) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698