commit | 769c9e539da8ca80aa914cd12276aa5bd79148ee | [log] [tgz] |
---|---|---|
author | David Brazdil <dbrazdil@google.com> | Mon Apr 27 13:54:09 2015 +0100 |
committer | David Brazdil <dbrazdil@google.com> | Mon Apr 27 17:00:58 2015 +0100 |
tree | 9aadf98a3fcbf7909f76c53fa2ee036ebda00304 | |
parent | 0fbfe6f92a2481daf914043262b5854e65d8c3cc [diff] [blame] |
ART: Simplify Ifs with BooleanNot condition If statements with negated condition can be simplified by removing the negation and swapping the true and false branches. Change-Id: I197afbc79fb7344d73b7b85d3611e7ca2519717f
diff --git a/test/458-checker-instruction-simplification/src/Main.java b/test/458-checker-instruction-simplification/src/Main.java index f0578ef..0dbda6b 100644 --- a/test/458-checker-instruction-simplification/src/Main.java +++ b/test/458-checker-instruction-simplification/src/Main.java
@@ -918,8 +918,12 @@ // CHECK: BooleanNot // CHECK-NOT: BooleanNot + public static boolean NegateValue(boolean arg) { + return !arg; + } + public static boolean NotNotBool(boolean arg) { - return !(!arg); + return !(NegateValue(arg)); } public static void main(String[] args) {