From d1aa7d0eec33e5f297d1eadedda714d4d0a3ef91 Mon Sep 17 00:00:00 2001 From: Artem Serov Date: Fri, 22 Jun 2018 11:35:46 +0100 Subject: 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 --- test/527-checker-array-access-split/src/Main.java | 27 +++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'test/527-checker-array-access-split/src/Main.java') 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]); } } -- cgit v1.2.3-59-g8ed1b