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

Unified Diff: src/compiler/node-matchers.h

Issue 1061303002: [turbofan] Match selects in control reducer (configurable). (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 8 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/control-reducer.cc ('k') | src/compiler/pipeline.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/node-matchers.h
diff --git a/src/compiler/node-matchers.h b/src/compiler/node-matchers.h
index 627829f4b56976a99e35a9ed23767995e1e821e9..6beca7c2c898f32ca0b6df06daddc5b31e0f2a23 100644
--- a/src/compiler/node-matchers.h
+++ b/src/compiler/node-matchers.h
@@ -570,6 +570,20 @@ struct DiamondMatcher : public NodeMatcher {
Node* IfFalse() const { return if_false_; }
Node* Merge() const { return node(); }
+ Node* TrueInputOf(Node* phi) const {
+ DCHECK(IrOpcode::IsPhiOpcode(phi->opcode()));
+ DCHECK_EQ(3, phi->InputCount());
+ DCHECK_EQ(Merge(), phi->InputAt(2));
+ return phi->InputAt(if_true_ == Merge()->InputAt(0) ? 0 : 1);
+ }
+
+ Node* FalseInputOf(Node* phi) const {
+ DCHECK(IrOpcode::IsPhiOpcode(phi->opcode()));
+ DCHECK_EQ(3, phi->InputCount());
+ DCHECK_EQ(Merge(), phi->InputAt(2));
+ return phi->InputAt(if_true_ == Merge()->InputAt(0) ? 1 : 0);
+ }
+
private:
Node* branch_;
Node* if_true_;
« no previous file with comments | « src/compiler/control-reducer.cc ('k') | src/compiler/pipeline.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698