OSDN Git Service

ART: Simplify (Not)Equal bool vs. int to true/false
authorDavid Brazdil <dbrazdil@google.com>
Mon, 22 Jun 2015 09:26:45 +0000 (10:26 +0100)
committerDavid Brazdil <dbrazdil@google.com>
Mon, 22 Jun 2015 10:07:57 +0000 (11:07 +0100)
commit1e9ec053008fca7eb713815716c69375c37b399c
treedc7306ce1153648bfc34c67b9475f7fbfbbd18f6
parente85647ed00d07169193cc07ffa09e3b70ce38f59
ART: Simplify (Not)Equal bool vs. int to true/false

Optimizations on the HGraph may produce comparisons of bool and ints.
Instruction simplifier will simplify these only for 0/1 int constants.
Since the range of bool is known, comparison against all other int
constants can always be determined statically.

Change-Id: I502651b7a08edf71ee0b2589069f00def6aacf66
compiler/optimizing/instruction_simplifier.cc
test/458-checker-instruction-simplification/src/Main.java