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

Unified Diff: src/compiler/common-operator-reducer.cc

Issue 2155123002: [turbofan] Eliminate checkpoints before return in common op reducer. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 5 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/compiler/checkpoint-elimination.cc ('k') | test/mjsunit/compiler/regress-628773.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/common-operator-reducer.cc
diff --git a/src/compiler/common-operator-reducer.cc b/src/compiler/common-operator-reducer.cc
index be4d802f818d06c140a4b2ac7b6b50679a3b7e99..1e91a0286b7561fd85b8ee648ba07949ee962e10 100644
--- a/src/compiler/common-operator-reducer.cc
+++ b/src/compiler/common-operator-reducer.cc
@@ -303,8 +303,14 @@ Reduction CommonOperatorReducer::ReducePhi(Node* node) {
Reduction CommonOperatorReducer::ReduceReturn(Node* node) {
DCHECK_EQ(IrOpcode::kReturn, node->opcode());
Node* const value = node->InputAt(0);
- Node* const effect = node->InputAt(1);
- Node* const control = node->InputAt(2);
+ Node* effect = NodeProperties::GetEffectInput(node);
+ Node* const control = NodeProperties::GetControlInput(node);
+ if (effect->opcode() == IrOpcode::kCheckpoint) {
+ // Any {Return} node can never be used to insert a deoptimization point,
+ // hence checkpoints can be cut out of the effect chain flowing into it.
+ effect = NodeProperties::GetEffectInput(effect);
+ NodeProperties::ReplaceEffectInput(node, effect);
Benedikt Meurer 2016/07/18 11:29:54 You need to say Changed(node) as you changed some
Jarin 2016/07/18 11:48:53 Good catch! Done.
+ }
if (value->opcode() == IrOpcode::kPhi &&
NodeProperties::GetControlInput(value) == control &&
effect->opcode() == IrOpcode::kEffectPhi &&
« no previous file with comments | « src/compiler/checkpoint-elimination.cc ('k') | test/mjsunit/compiler/regress-628773.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698