diff options
author | Mark Mendell <mark.p.mendell@intel.com> | 2015-05-22 16:58:19 -0400 |
---|---|---|
committer | Mark Mendell <mark.p.mendell@intel.com> | 2015-11-05 10:44:24 -0500 |
commit | b8b97695d178337736b61609220613b92f344d45 (patch) | |
tree | 8b412373d1f21cac78168e284e36977a7fab0875 /compiler/optimizing/code_generator_utils.h | |
parent | b24301b06b31b463f7e92ebc9a8f75839e54b746 (diff) |
Fix conditional jump over jmp (X86/X86-64/ARM32)
Optimize the code generation for 'if' statements to jump to the
'false' block if the next block to be generated is the 'true' block.
Add an X86-64 test for this case.
Note that ARM64 & MIPS64 have not been updated.
Change-Id: Iebb1352feb9d3bd0142d8b0621a2e3069a708ea7
Signed-off-by: Mark Mendell <mark.p.mendell@intel.com>
Diffstat (limited to 'compiler/optimizing/code_generator_utils.h')
-rw-r--r-- | compiler/optimizing/code_generator_utils.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/compiler/optimizing/code_generator_utils.h b/compiler/optimizing/code_generator_utils.h index 59b495c2c9..628eee8885 100644 --- a/compiler/optimizing/code_generator_utils.h +++ b/compiler/optimizing/code_generator_utils.h @@ -21,10 +21,19 @@ namespace art { +class Label; +class HCondition; + // 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); + } // namespace art #endif // ART_COMPILER_OPTIMIZING_CODE_GENERATOR_UTILS_H_ |