summaryrefslogtreecommitdiff
path: root/compiler/optimizing/code_generator_utils.cc
AgeCommit message (Collapse)Author
2020-09-18ARM: Optimize div/rem when dividend is compared with a non-negativeEvgeny Astigeevich
When a divisor is a positive constant and a dividend is compared with a non-negative value, the result of the comparison can guarantee that the dividend is non-negative. In such a case there is no need to generate instructions correcting the result of div/rem. The CL implements this optimization for ARM32/ARM64. Test: 411-checker-hdiv-hrem-pow2 Test: 411-checker-hdiv-hrem-const Test: test.py --host --optimizing --jit --gtest --interpreter Test: test.py -target --optimizing --jit --interpreter Test: run-gtests.sh Change-Id: If1dc1389f6e34d2be3480ef620a626f389ca53a5
2020-08-18ART: Add HasNonNegativeInputAt and HasNonNegativeOrMinIntInputAtEvgeny Astigeevich
When it can be quickly checked that an input operand in non-negative, additional optimizations can be applied during code generation. The CL adds HasNonNegativeInputAt and HasNonNegativeOrMinIntInputAt which can be used to check if the input operand of an instruction at the index is non-negative. They guarantee that at the time of checks the instruction can have non-negative inputs. Other optimizations after that might break the invariant. Optimizations HRem/HDiv for ARM32/ARM64 are moved to used the new methods. Test: 411-checker-hdiv-hrem-pow2 Test: 411-checker-hdiv-hrem-const Test: test.py --host --optimizing --jit --gtest --interpreter Test: test.py -target --optimizing --jit --interpreter Test: run-gtests.sh Change-Id: Icf8574699e003bba194097c4e39660de16aa53d9
2020-07-02ARM: Optimize Div/Rem by 2^n for non-negative dividendsEvgeny Astigeevich
When it can be proved that dividends are non-negative or the min integer if their type is integral, there is no need to generate instructions correcting the result. The CL implements this optimization for ARM32/ARM64. Test: 411-checker-hdiv-hrem-pow2 Test: test.py --host --optimizing --jit --gtest --interpreter Test: test.py -target --optimizing --jit --interpreter Test: run-gtests.sh Change-Id: I11211a42918b5801fce8e78f305e69549739c23c
2019-10-14Revert "Make compiler/optimizing/ symbols hidden."Vladimir Marko
This reverts commit e2727154f25e0db9a5bb92af494d8e47b181dfcf. Reason for revert: Breaks ASAN tests (ODR violation). Bug: 142365358 Change-Id: I38103d74a1297256c81d90872b6902ff1e9ef7a4
2019-10-14Make compiler/optimizing/ symbols hidden.Vladimir Marko
Make symbols in compiler/optimizing hidden by a namespace attribute. The unit intrinsic_objects.{h,cc} is excluded as it is needed by dex2oat. As the symbols are no longer exported, gtests are now linked with the static version of the libartd-compiler library. libart-compiler.so size: - before: arm: 2396152 arm64: 3345280 - after: arm: 2016176 (-371KiB, -15.9%) arm64: 2874480 (-460KiB, -14.1%) Test: m test-art-host-gtest Test: testrunner.py --host --optimizing --jit Bug: 142365358 Change-Id: I1fb04a33351f53f00b389a1642e81a68e40912a8
2017-12-07ART: Replace base/logging with android-base/loggingAndreas Gampe
Replace wherever possible. ART's base/logging is now mainly VLOG and initialization code that is unnecessary to pull in and makes changes to verbose logging more painful than they have to be. Test: m test-art-host Change-Id: I3e3a4672ba5b621e57590a526c7d1c8b749e4f6e
2016-01-28ART: Implement support for instruction inliningDavid Brazdil
Optimizing HIR contains 'non-materialized' instructions which are emitted at their use sites rather than their defining sites. This was not properly handled by the liveness analysis which did not adjust the use positions of the inputs of such instructions. Despite the analysis being incorrect, the current use cases never produce incorrect code. This patch generalizes the concept of inlined instructions and updates liveness analysis to set the compute use positions correctly. Change-Id: Id703c154b20ab861241ae5c715a150385d3ff621
2015-11-17ART: Refactor GenerateTestAndBranchDavid Brazdil
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
2015-11-05Fix conditional jump over jmp (X86/X86-64/ARM32)Mark Mendell
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>
2015-04-10Follow up of "div/rem on x86 and x86_64", to tidy up the code a little.Guillaume Sanchez
Change-Id: Ibf39cbc8ac1d773599d70be2cb1e941674b60f1d
2015-04-09Speedup div/rem by constants on x86 and x86_64Guillaume Sanchez
This is done using the algorithms in Hacker's Delight chapter 10. Change-Id: I7bacefe10067569769ed31a1f7834f796fb41119