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

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

Issue 749233002: [turbofan] Combine Word32And with Int32Add and negative power of two. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Unit test Created 6 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
Index: src/compiler/node-matchers.h
diff --git a/src/compiler/node-matchers.h b/src/compiler/node-matchers.h
index c748c61e6a9cc0624c074bde0a579378b067abff..33ddf9a10df26d868b1f7915642a0aacc73a1f23 100644
--- a/src/compiler/node-matchers.h
+++ b/src/compiler/node-matchers.h
@@ -80,6 +80,10 @@ struct IntMatcher FINAL : public ValueMatcher<T, kOpcode> {
return this->HasValue() && this->Value() > 0 &&
(this->Value() & (this->Value() - 1)) == 0;
}
+ bool IsNegativePowerOf2() const {
+ return this->HasValue() && this->Value() < 0 &&
+ (-this->Value() & (-this->Value() - 1)) == 0;
+ }
};
typedef IntMatcher<int32_t, IrOpcode::kInt32Constant> Int32Matcher;

Powered by Google App Engine
This is Rietveld 408576698