summaryrefslogtreecommitdiff
path: root/compiler/optimizing/code_generator_utils.h
diff options
context:
space:
mode:
authorDavid Brazdil <dbrazdil@google.com>2015-11-12 18:37:00 +0000
committerDavid Brazdil <dbrazdil@google.com>2015-11-17 15:12:00 +0000
commit0debae7bc89eb05f7a2bf7dccd223318fad7c88d (patch)
tree3da9656dc77d271b12c1b02793e7d713ae3da790 /compiler/optimizing/code_generator_utils.h
parent991842a5273d20695dd5f35eb9a9e28c386c5b4b (diff)
ART: Refactor GenerateTestAndBranch
Each code generator implements a method for generating condition evaluation and branching to arbitrary labels. This patch refactors it for better clarity but also to generate fewer jumps when the true branch is the fallthrough successor. This is preliminary work for implementing HSelect. Change-Id: Iaa545a5ecbacb761c5aa241fa69140cf6eb5952f
Diffstat (limited to 'compiler/optimizing/code_generator_utils.h')
-rw-r--r--compiler/optimizing/code_generator_utils.h12
1 files changed, 5 insertions, 7 deletions
diff --git a/compiler/optimizing/code_generator_utils.h b/compiler/optimizing/code_generator_utils.h
index 628eee8885..7efed8c9ec 100644
--- a/compiler/optimizing/code_generator_utils.h
+++ b/compiler/optimizing/code_generator_utils.h
@@ -21,18 +21,16 @@
namespace art {
-class Label;
-class HCondition;
+class HInstruction;
// Computes the magic number and the shift needed in the div/rem by constant algorithm, as out
// arguments `magic` and `shift`
void CalculateMagicAndShiftForDivRem(int64_t divisor, bool is_long, int64_t* magic, int* shift);
-// Is it valid to reverse the condition? Uses the values supplied to
-// GenerateTestAndBranch() in instruction generators.
-bool CanReverseCondition(Label* always_true_target,
- Label* false_target,
- HCondition* condition);
+// Returns true if `cond_input` is expected to have a location. Assumes that
+// `cond_input` is a conditional input of the currently emitted instruction and
+// that it has been previously visited by the InstructionCodeGenerator.
+bool IsBooleanValueOrMaterializedCondition(HInstruction* cond_input);
} // namespace art