ART: Remove unneeded SideEffects for fatal instructions.
Remove "CanTriggerGC" side effect for NullCheck, BoundsCheck and
DivZeroCheck - instructions which have fatal slow paths. Even though
GC might happen after going through those instructions' slow path
execution doesn't return to the next instruction after the
exceptional one so side effects can be relaxed.
Performance improvement (angler, arm64, little core):
- Geomean: 2.8%
- Particular benchmarks
- algorithm/Sort.SystemSort: 13.0%
- stanford/IntMM: 12.7%
- stanford/Puzzle: 9.5%
- benchmarksgame/revcomp: 8.9%
- reversigame/Reversi: 3.5%
Test: 510-checker-try-catch.
Test: 706-checker-scheduler.
Test: 527-checker-array-access-split.
Test: test-art-host, test-art-target.
Change-Id: I55ac011822e5dbac82c828a700213dbea87329c8
diff --git a/test/527-checker-array-access-split/src/Main.java b/test/527-checker-array-access-split/src/Main.java
index 935b378..f83c924 100644
--- a/test/527-checker-array-access-split/src/Main.java
+++ b/test/527-checker-array-access-split/src/Main.java
@@ -552,6 +552,28 @@
return (int)s;
}
+ //
+ // Check that IntermediateAddress can be shared across BoundsCheck, DivZeroCheck and NullCheck -
+ // instruction which have fatal slow paths.
+ //
+ /// CHECK-START-{ARM,ARM64}: void Main.checkGVNForFatalChecks(int, int, char[], int[]) GVN$after_arch (before)
+ /// CHECK: IntermediateAddress
+ /// CHECK: IntermediateAddress
+ //
+ /// CHECK-NOT: IntermediateAddress
+
+ /// CHECK-START-{ARM,ARM64}: void Main.checkGVNForFatalChecks(int, int, char[], int[]) GVN$after_arch (after)
+ /// CHECK: IntermediateAddress
+ //
+ /// CHECK-NOT: IntermediateAddress
+ public final static void checkGVNForFatalChecks(int begin, int end, char[] buf1, int[] buf2) {
+ buf1[begin] = 'a';
+ buf2[0] = begin / end;
+ buf1[end] = 'n';
+ }
+
+ public final static int ARRAY_SIZE = 128;
+
public static void main(String[] args) {
int[] array = {123, 456, 789};
@@ -575,5 +597,10 @@
assertIntEquals(2097152, canMergeAfterBCE2());
assertIntEquals(18, checkLongFloatDouble());
+
+ char[] c1 = new char[ARRAY_SIZE];
+ int[] i1 = new int[ARRAY_SIZE];
+ checkGVNForFatalChecks(1, 2, c1, i1);
+ assertIntEquals('n', c1[2]);
}
}