diff options
author | 2018-06-22 11:35:46 +0100 | |
---|---|---|
committer | 2018-08-31 12:34:32 +0100 | |
commit | d1aa7d0eec33e5f297d1eadedda714d4d0a3ef91 (patch) | |
tree | e8a3876705be966611a06659e9f4b848205f3957 /test/527-checker-array-access-split/src/Main.java | |
parent | 11529ab4cdf06e579182fa4252170aa4541f4ce9 (diff) |
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
Diffstat (limited to 'test/527-checker-array-access-split/src/Main.java')
-rw-r--r-- | test/527-checker-array-access-split/src/Main.java | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/test/527-checker-array-access-split/src/Main.java b/test/527-checker-array-access-split/src/Main.java index 935b37858d..f83c924de9 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 @@ public class Main { 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 @@ public class Main { 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]); } } |