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

Unified Diff: tests/language/vm/load_to_load_forwarding_vm_test.dart

Issue 145133009: Improve aliasing info for load elimination of array loads. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 11 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
« runtime/vm/flow_graph_optimizer.cc ('K') | « runtime/vm/flow_graph_optimizer.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/language/vm/load_to_load_forwarding_vm_test.dart
===================================================================
--- tests/language/vm/load_to_load_forwarding_vm_test.dart (revision 31975)
+++ tests/language/vm/load_to_load_forwarding_vm_test.dart (working copy)
@@ -212,7 +212,41 @@
return v + w;
}
+testIndexedNoAlias(a) {
+ a[0] = 1;
+ a[1] = 2;
+ a[2] = 3;
+ return a[0] + a[1];
+}
+testIndexedAliasedStore(a, b) {
+ a[0] = 1;
+ a[1] = 2;
+ if (a == b) {
+ b[0] = 3;
+ }
+ return a[0] + a[1];
+}
+
+testIndexedAliasedStore1(a, b) {
+ a[0] = 1;
+ a[1] = 2;
+ if (a == b) {
+ b[0] = 3;
+ }
+ return a[0] + a[1];
+}
+
+testIndexedAliasedStore2(a, b, i) {
+ a[0] = 1;
+ a[1] = 2;
+ if (a == b) {
+ b[i] = 3;
+ }
+ return a[0] + a[1];
+}
+var indices = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
+
main() {
final fixed = new List(10);
final growable = [];
@@ -263,4 +297,15 @@
for (var i = 0; i < 20; i++) {
fakeAliasing(escape);
}
+
+ final array = new List(3);
+ for (var i = 0; i < 20; i++) {
+ Expect.equals(3, testIndexedNoAlias(array));
+ }
+ for (var i = 0; i < 20; i++) {
+ Expect.equals(5, testIndexedAliasedStore1(array, array));
+ }
+ for (var i = 0; i < 20; i++) {
+ Expect.equals(4, testIndexedAliasedStore2(array, array, indices[1]));
+ }
}
« runtime/vm/flow_graph_optimizer.cc ('K') | « runtime/vm/flow_graph_optimizer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698