summaryrefslogtreecommitdiff
path: root/test/463-checker-boolean-simplifier/src/Main.java
diff options
context:
space:
mode:
author David Brazdil <dbrazdil@google.com> 2015-04-17 14:52:19 +0100
committer David Brazdil <dbrazdil@google.com> 2015-04-20 18:11:39 +0100
commit0d13fee6f4330cc9cb100c43135490a34c11d7a5 (patch)
treee96f089c1e384772bebdd8d8701c95d73569f29c /test/463-checker-boolean-simplifier/src/Main.java
parent27eac12a66a73eb38b5ccb45b62350cf341299d0 (diff)
ART: Simplify more bool operations
Now that we have the HBooleanNot instruction, the instruction simplifier can optimize out more conditions comparing a boolean against a constant, as well as sequences of Boolean negations. Change-Id: I7f634f6428a3984dd97b27b3d6362491346f1ff6
Diffstat (limited to 'test/463-checker-boolean-simplifier/src/Main.java')
-rw-r--r--test/463-checker-boolean-simplifier/src/Main.java15
1 files changed, 8 insertions, 7 deletions
diff --git a/test/463-checker-boolean-simplifier/src/Main.java b/test/463-checker-boolean-simplifier/src/Main.java
index efe0d3f729..3daf6934fa 100644
--- a/test/463-checker-boolean-simplifier/src/Main.java
+++ b/test/463-checker-boolean-simplifier/src/Main.java
@@ -27,16 +27,15 @@ public class Main {
}
/*
- * Elementary test negating a boolean. Verifies that the condition is replaced,
- * blocks merged and empty branches removed.
+ * Elementary test negating a boolean. Verifies that blocks are merged and
+ * empty branches removed.
*/
// CHECK-START: boolean Main.BooleanNot(boolean) boolean_simplifier (before)
// CHECK-DAG: [[Param:z\d+]] ParameterValue
// CHECK-DAG: [[Const0:i\d+]] IntConstant 0
// CHECK-DAG: [[Const1:i\d+]] IntConstant 1
- // CHECK-DAG: [[NotEq:z\d+]] NotEqual [ [[Param]] [[Const0]] ]
- // CHECK-DAG: If [ [[NotEq]] ]
+ // CHECK-DAG: If [ [[Param]] ]
// CHECK-DAG: [[Phi:i\d+]] Phi [ [[Const1]] [[Const0]] ]
// CHECK-DAG: Return [ [[Phi]] ]
@@ -49,11 +48,10 @@ public class Main {
// CHECK-START: boolean Main.BooleanNot(boolean) boolean_simplifier (after)
// CHECK-DAG: [[Param:z\d+]] ParameterValue
// CHECK-DAG: [[Const0:i\d+]] IntConstant 0
- // CHECK-DAG: [[Eq:z\d+]] Equal [ [[Param]] [[Const0]] ]
- // CHECK-DAG: Return [ [[Eq]] ]
+ // CHECK-DAG: [[NotParam:z\d+]] BooleanNot [ [[Param]] ]
+ // CHECK-DAG: Return [ [[NotParam]] ]
// CHECK-START: boolean Main.BooleanNot(boolean) boolean_simplifier (after)
- // CHECK-NOT: NotEqual
// CHECK-NOT: If
// CHECK-NOT: Phi
@@ -115,6 +113,9 @@ public class Main {
// CHECK-DAG: [[Cond:z\d+]] LessThan [ [[ParamX]] [[ParamY]] ]
// CHECK-DAG: Return [ [[Cond]] ]
+ // CHECK-START: boolean Main.LessThan(int, int) boolean_simplifier (after)
+ // CHECK-NOT: GreaterThanOrEqual
+
public static boolean LessThan(int x, int y) {
return (x < y) ? true : false;
}