Relax loop-back-edge-use for different dexers.
D8 is less aggressive with removing transitive gotos when
--no-locals is not used in case the user wants a breakpoint
in the middle of that empty loop.
Consider:
while (...) {
boolean incoming = field;
while (incoming) {
}
}
DX would just generate:
|0007: invoke-static {}, LMain;.$opt$noinline$ensureSideEffects:()Z // method@0000
|000a: move-result v1
|000b: if-eqz v1, 0012 // +0007
|000d: sget-boolean v0, LMain;.field:Z // field@0001
|000f: if-eqz v0, 0007 // -0008
|0011: goto 000f // -0002
|0012: return-void
D8 would generate:
0007: invoke-static {}, LMain;.$opt$noinline$ensureSideEffects:()Z // method@0000
000a: move-result v0
000b: if-eqz v0, 0013 // +0008
000d: sget-boolean v0, LMain;.field:Z // field@0001
000f: if-eqz v0, 0012 // +0003
0011: goto 000f // -0002
0012: goto 0007 // -000b
0013: return-void
The extra basic block changes the order of the graph printing a bit.
Change-Id: I8f6149ba20b34ca0c50ec80c36aed13fb45e55ea
Consider:
Bug: 65168732
Test: USE_D8=true ./art/test.py -b --host -r -t 482-checker-loop-back-edge-use
USE_D8=false ./art/test.py -b --host -r -t 482-checker-loop-back-edge-use
diff --git a/test/482-checker-loop-back-edge-use/build b/test/482-checker-loop-back-edge-use/build
deleted file mode 100644
index 10ffcc5..0000000
--- a/test/482-checker-loop-back-edge-use/build
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/bin/bash
-#
-# Copyright 2017 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# See b/65168732
-export USE_D8=false
-
-./default-build "$@"
diff --git a/test/482-checker-loop-back-edge-use/src/Main.java b/test/482-checker-loop-back-edge-use/src/Main.java
index 86977d1..4782340 100644
--- a/test/482-checker-loop-back-edge-use/src/Main.java
+++ b/test/482-checker-loop-back-edge-use/src/Main.java
@@ -174,8 +174,8 @@
/// CHECK: <<Arg:z\d+>> StaticFieldGet liveness:<<ArgLiv:\d+>> ranges:{[<<ArgLiv>>,<<ArgLoopUse:\d+>>)} uses:[<<ArgUse:\d+>>,<<ArgLoopUse>>]
/// CHECK: If [<<Arg>>] liveness:<<IfLiv:\d+>>
/// CHECK: Goto liveness:<<GotoLiv1:\d+>>
- /// CHECK: Exit
- /// CHECK: Goto liveness:<<GotoLiv2:\d+>>
+ /// CHECK-DAG: Goto liveness:<<GotoLiv2:\d+>>
+ /// CHECK-DAG: Exit
/// CHECK-EVAL: <<IfLiv>> + 1 == <<ArgUse>>
/// CHECK-EVAL: <<GotoLiv1>> < <<GotoLiv2>>
/// CHECK-EVAL: <<GotoLiv1>> + 2 == <<ArgLoopUse>>