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

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

Issue 2789713003: [turbofan] load elimination looks through TypeGuards (Closed)
Patch Set: Created 3 years, 9 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 | « 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 97b35c0b86445c950d24d2a3b9f1ae8f4ed33bc0..cc73fadfa05c61023e7afa176d5f951358f9c6fc 100644
--- a/src/compiler/load-elimination.cc
+++ b/src/compiler/load-elimination.cc
@@ -19,7 +19,16 @@ namespace {
enum Aliasing { kNoAlias, kMayAlias, kMustAlias };
+Node* Normalize(Node* node) {
Benedikt Meurer 2017/03/31 12:48:36 Just do it like FinishRegion below please.
+ while (node->opcode() == IrOpcode::kTypeGuard) {
+ node = node->InputAt(0);
+ }
+ return node;
+}
+
Aliasing QueryAlias(Node* a, Node* b) {
+ a = Normalize(a);
+ b = Normalize(b);
if (a == b) return kMustAlias;
if (!NodeProperties::GetType(a)->Maybe(NodeProperties::GetType(b))) {
return kNoAlias;
« 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