summaryrefslogtreecommitdiff
path: root/compiler/optimizing/graph_visualizer.cc
AgeCommit message (Collapse)Author
2020-07-22Dump instruction set features in .cfgFabio Rinaldi
This commit adds a compilation block at the beginning of the .cfg dumped by the optimizing compiler when --dump-cfg is enabled. The compilation block appears in the following form: begin_compilation name "isa_features:feature1,-feature2" method "isa_features:feature1,-feature2" date 1580721972 end_compilation This compilation block dump is passed to checker script (see https://android-review.googlesource.com/c/platform/art/+/1290997) for checking if a certain instruction set feature was used at compile time. Author: Fabio Rinaldi Committer: Artem Serov Bug: 147876827 Test: ./art/tools/checker/run_unit_tests.py Test: test.py --target --optimizing Change-Id: If4309af4bab892f715aad1d3bd338f8ee11e497c
2020-06-11Clean up generated operator<<(os, enum).Vladimir Marko
Pass enums by value instead of const reference. Do not generate operator<< sources for headers that have no enums or no declarations of operator<<. Do not define the operator<< for flag enums; these were unused anyway. Add generated operator<< for some enums in nodes.h . Change the operator<< for ComparisonBias so that the graph visualizer can use it but do not use the generated operator<< yet as that would require changing checker tests. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Change-Id: Ifd4c455c2fa921a9668c966a13068d43b9c6e173
2020-02-21Make `libart(d)-disassembler` a requirement of `libart(d)-compiler`.Roland Levillain
The constructor of `art::HGraphVisualizerDisassembler` (which is part of `libart(d)-compiler.so`) may dynamically load `libart(d)-disassembler.so`; add `libart(d)-disassembler` to the `runtime_libs` property of module `libart(d)-compiler` to make sure the former can be found. Also promote the failure to dynamically load `libart(s)-disassembler.so` in `art::HGraphVisualizerDisassembler::HGraphVisualizerDisassembler` from `WARNING` to `ERROR`. Test: art/tools/buildbot-build.sh --host \ && art/test/testrunner/testrunner.py --host --optimizing \ -t 640-checker-integer-valueof Bug: 149749169 Change-Id: I307bdf8b71e47ed8da1d6d62ab688c500b3f9c80
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
2019-06-11Move IntrusiveForwardList<> to libartbase.Vladimir Marko
It's generally useful, not just for the compiler. Test: m test-art-host-gtest Change-Id: I3ca742d93a0bca961d1b8b8209356747d2de08a0
2019-01-02ART: Move dex structs into own headerAndreas Gampe
Separating out the structs from DexFile allows them to be forward- declared, which reduces the need to include the dex_file header. Bug: 119869270 Test: m Change-Id: I32dde5a632884bca7435cd584b4a81883de2e7b4
2018-12-27ART: Refactor for bugprone-argument-commentAndreas Gampe
Handles compiler. Bug: 116054210 Test: WITH_TIDY=1 mmma art Change-Id: I5cdfe73c31ac39144838a2736146b71de037425e
2018-09-25Merge "ART: ARM64: Support DotProd SIMD idiom."Treehugger Robot
2018-09-25ART: ARM64: Support DotProd SIMD idiom.Artem Serov
Implement support for vectorization idiom which performs dot product of two vectors and adds the result to wider precision components in the accumulator. viz. DOT_PRODUCT([ a1, .. , am], [ x1, .. , xn ], [ y1, .. , yn ]) = [ a1 + sum(xi * yi), .. , am + sum(xj * yj) ], for m <= n, non-overlapping sums, for either both signed or both unsigned operands x, y. The patch shows up to 7x performance improvement on a micro benchmark on Cortex-A57. Test: 684-checker-simd-dotprod. Test: test-art-host, test-art-target. Change-Id: Ibab0d51f537fdecd1d84033197be3ebf5ec4e455
2018-09-20Revert^2 "ART: Refactor typedef to using"Andreas Gampe
This reverts commit ee07743e03042c2ca36e0c9513847a9e7d2509f1. Reason for revert: fixed attributes. Bug: 32619234 Test: m test-art-host Test: m test-art-target-gtest-unstarted_runtime_test Change-Id: I6f0a775adfdf6ecd132b470f7c5446e949872e20
2018-09-20Revert "ART: Refactor typedef to using"Andreas Gampe
This reverts commit 9a20ff06f7ccee08a742c315ec6d351ab56ba1cd. Reason for revert: Attributes on the wrong side. Bug: 32619234 Change-Id: I8fd2abef619b22c02ccfbf5ae629339f1a60918b
2018-09-19ART: Refactor typedef to usingAndreas Gampe
Add clang-tidy's modernize-use-using. Bug: 32619234 Test: WITH_TIDY=1 mmma art Change-Id: If50d37b5152af4270784e3cde7951292a9e19033
2018-08-28Use 'final' and 'override' specifiers directly in ART.Roland Levillain
Remove all uses of macros 'FINAL' and 'OVERRIDE' and replace them with 'final' and 'override' specifiers. Remove all definitions of these macros as well, which were located in these files: - libartbase/base/macros.h - test/913-heaps/heaps.cc - test/ti-agent/ti_macros.h ART is now using C++14; the 'final' and 'override' specifiers have been introduced in C++11. Test: mmma art Change-Id: I256c7758155a71a2940ef2574925a44076feeebf
2018-05-11ART: Compiler support for const-method-handleOrion Hodson
Implemented as a runtime call. Bug: 66890674 Test: art/test.py --target -r -t 979 Test: art/test.py --target --64 -r -t 979 Test: art/test.py --host -r -t 979 Change-Id: I67f461c819a7d528d7455afda8b4a59e9aed381c
2018-05-10ART: Compiler support for const-method-typeOrion Hodson
Implemented as a runtime call. Bug: 66890674 Test: art/test.py --target -r -t 979 Test: art/test.py --target --64 -r -t 979 Test: art/test.py --host -r -t 979 Change-Id: I4b3d3969d455d0198cfe122eea8abd54e0ea20ee
2018-03-27Merge "Revert^4 "Compiler changes for bitstring based type checks.""Treehugger Robot
2018-03-27Revert^4 "Compiler changes for bitstring based type checks."Vladimir Marko
Disabled the build time flag. (No image version bump needed.) Bug: 26687569 Bug: 64692057 Bug: 76420366 This reverts commit 3fbd3ad99fad077e5c760e7238bcd55b07d4c06e. Change-Id: I5d83c4ce8a7331c435d5155ac6e0ce1c77d60004
2018-03-26Revert^3 "Compiler changes for bitstring based type checks."Andreas Gampe
This reverts commit 3f41323cc9da335e9aa4f3fbad90a86caa82ee4d. Reason for revert: Fails sporadically. Bug: 26687569 Bug: 64692057 Bug: 76420366 Change-Id: I84d1e9e46c58aeecf17591ff71fbac6a1e583909
2018-03-26ART: Fix infinite recursion for deopt at dex pc 0.Vladimir Marko
Previously, the interpreter checked for dex pc 0 to see if the method was just entered. If we deopt at dex pc 0, the instrumentation would emit an erroneous MethodEnteredEvent and the JIT would have received a MethodEntered() call. For JIT-on-first-use, the method would be compiled the same way as before, leading to the same deopt until stack overflow. We fix this by using a new `from_deoptimize` flag passed by the caller. Test: 680-checker-deopt-dex-pc-0 Test: testrunner.py --host \ --jit --runtime-option=-Xjitthreshold:0 Bug: 62611253 Change-Id: I50b88f15484aeae16e1375a1d80f6563fb9066e7
2018-03-22Revert^2 "Compiler changes for bitstring based type checks."Vladimir Marko
Add extra output for debugging failures and re-enable the bitstring type checks. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing --jit Test: testrunner.py --host -t 670-bitstring-type-check Test: Pixel 2 XL boots. Test: testrunner.py --target --optimizing --jit Test: testrunner.py --target -t 670-bitstring-type-check Bug: 64692057 Bug: 26687569 This reverts commit bff7a52e2c6c9e988c3ed1f12a2da0fa5fd37cfb. Change-Id: I090e241983f3ac6ed8394d842e17716087d169ac
2018-02-21Remove duplication, split testsDavid Sehr
The code move to libdexfile/dex/descriptors_names.cc apparently did not remove the original code from runtime/utils.cc. Fix that duplication and all the header mentions needed. Also, split the test files to go along with the new locations for the code to be tested. Bug: 22322814 Test: make -j 50 checkbuild make -j 50 test-art-host-gtest flash & boot marlin Change-Id: Ie734672c4bca2c647d8016291f910b5608674545
2018-02-07Don't analyze methods with verification errors.Aart Bik
With regression test! Bug: 72874888 Test: test-art-host Change-Id: Icb3ec5dbfa14a1f77da681ba7e100ec9a5ab9ba6
2018-02-01Clean up signed/unsigned in vectorizer.Aart Bik
Rationale: Currently we have some remaining ugliness around signed and unsigned SIMD operations due to lack of kUint32 and kUint64 in the HIR. By "softly" introducing these types, ABS/MIN/MAX/HALVING_ADD/SAD_ACCUMULATE operations can solely rely on the packed data types to distinguish between signed and unsigned operations. Cleaner, and also allows for some code removal in the current loop optimizer. Bug: 72709770 Test: test-art-host test-art-target Change-Id: I68e4cdfba325f622a7256adbe649735569cab2a3
2018-01-25Revert "Compiler changes for bitstring based type checks."Nicolas Geoffray
Bug: 64692057 Bug: 71853552 Bug: 26687569 This reverts commit eb0ebed72432b3c6b8c7b38f8937d7ba736f4567. Change-Id: I7daeaa077960ba41b2ed42bc47f17501621be4be
2018-01-23Compiler changes for bitstring based type checks.Vladimir Marko
We guard the use of this feature with a compile-time flag, set to true in this CL. Boot image size for aosp_taimen-userdebug in AOSP master: - before: arm boot*.oat: 63604740 arm64 boot*.oat: 74237864 - after: arm boot*.oat: 63531172 (-72KiB, -0.1%) arm64 boot*.oat: 74135008 (-100KiB, -0.1%) The new TypeCheckBenchmark yields the following changes using the little cores of taimen fixed at 1.4016GHz: 32-bit 64-bit timeCheckCastLevel1ToLevel1 11.48->15.80 11.47->15.78 timeCheckCastLevel2ToLevel1 15.08->15.79 15.08->15.79 timeCheckCastLevel3ToLevel1 19.01->15.82 17.94->15.81 timeCheckCastLevel9ToLevel1 42.55->15.79 42.63->15.81 timeCheckCastLevel9ToLevel2 39.70->14.36 39.70->14.35 timeInstanceOfLevel1ToLevel1 13.74->17.93 13.76->17.95 timeInstanceOfLevel2ToLevel1 17.02->17.95 16.99->17.93 timeInstanceOfLevel3ToLevel1 24.03->17.95 24.45->17.95 timeInstanceOfLevel9ToLevel1 47.13->17.95 47.14->18.00 timeInstanceOfLevel9ToLevel2 44.19->16.52 44.27->16.51 This suggests that the bitstring typecheck should not be used for exact type checks which would be equivalent to the "Level1ToLevel1" benchmark. Whether the implementation is a beneficial replacement for the kClassHierarchyCheck and kAbstractClassCheck on average depends on how many levels from the target class (or Object for a negative result) is a typical object's class. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing --jit Test: testrunner.py --host -t 670-bitstring-type-check Test: Pixel 2 XL boots. Test: testrunner.py --target --optimizing --jit Test: testrunner.py --target -t 670-bitstring-type-check Bug: 64692057 Bug: 71853552 Bug: 26687569 Change-Id: I538d7e036b5a8ae2cc3fe77662a5903d74854562
2017-11-02ART: Make InstructionSet an enum class and add kLast.Vladimir Marko
Adding InstructionSet::kLast shall make it easier to encode the InstructionSet in fewer bits using BitField<>. However, introducing `kLast` into the `art` namespace is not a good idea, so we change the InstructionSet to an enum class. This also uncovered a case of InstructionSet::kNone being erroneously used instead of vixl32::Condition::None(), so it's good to remove `kNone` from the `art` namespace. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Change-Id: I6fa6168dfba4ed6da86d021a69c80224f09997a6
2017-10-27Alignment optimizations in vectorizer.Aart Bik
Rationale: Since aligned data access is generally better (enables more efficient aligned moves and prevents nasty cache line splits), computing and/or enforcing alignment has been added to the vectorizer: (1) If the initial alignment is known completely and suffices, then a static peeling factor enforces proper alignment. (2) If (1) fails, but the base alignment allows, dynamically peeling until total offset is aligned forces proper aligned access patterns. By using ART conventions only, any forced alignment is preserved over suspends checks where data may move. Note 1: Current allocation convention is just 8 byte alignment on arrays/strings, so only ARM32 benefits. However, all optimizations are implemented in a general way, so moving to a 16 byte alignment will immediately take advantage of any new convention!! Note 2: This CL also exposes how bad the choice of 12 byte offset of arrays really is. Even though the new optimizations fix the misaligned, it requires peeling for the most common case: 0 indexed loops. Therefore, we may even consider moving to a 16 byte offset. Again the optimizations in this CL will immediately take advantage of that new convention!! Test: test-art-host test-art-target Change-Id: Ib6cc0fb68c9433d3771bee573603e64a3a9423ee
2017-10-11Use ScopedArenaAllocator for building HGraph.Vladimir Marko
Memory needed to compile the two most expensive methods for aosp_angler-userdebug boot image: BatteryStats.dumpCheckinLocked() : 21.1MiB -> 20.2MiB BatteryStats.dumpLocked(): 42.0MiB -> 40.3MiB This is because all the memory previously used by the graph builder is reused by later passes. And finish the "arena"->"allocator" renaming; make renamed allocator pointers that are members of classes const when appropriate (and make a few more members around them const). Test: m test-art-host-gtest Test: testrunner.py --host Bug: 64312607 Change-Id: Ia50aafc80c05941ae5b96984ba4f31ed4c78255e
2017-10-03ART: Introduce Uint8 compiler data type.Vladimir Marko
This CL adds all the necessary codegen for the Uint8 type but does not add code transformations that use that code. Vectorization codegens are modified to use Uint8 as the packed type when appropriate. The side effects are now disconnected from the instruction's type after the graph has been built to allow changing HArrayGet/H*FieldGet/HVecLoad to use a type different from the underlying field or array. Note: HArrayGet for String.charAt() is modified to have no side effects whatsoever; Strings are immutable. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing --jit Test: testrunner.py --target --optimizing on Nexus 6P Test: Nexus 6P boots. Bug: 23964345 Change-Id: If2dfffedcfb1f50db24570a1e9bd517b3f17bfd0
2017-09-25ART: Introduce compiler data type.Vladimir Marko
Replace most uses of the runtime's Primitive in compiler with a new class DataType. This prepares for introducing new types, such as Uint8, that the runtime does not need to know about. Test: m test-art-host-gtest Test: testrunner.py --host Bug: 23964345 Change-Id: Iec2ad82454eec678fffcd8279a9746b90feb9b0c
2017-08-30ART: Describe static fields in GraphVisualizer.Vladimir Marko
Test: Rely on TreeHugger. Change-Id: I3388a469a96c665abc51abe2cf7d2b2004db7d78
2017-06-26Don't use the graph's dex file when printing HInvoke.Nicolas Geoffray
It's not the right dex file if the invokes come from inlined methods. Test: manual Change-Id: I4e3fb35e2bddc67510c39e12075c9a5ca0498a3a
2017-06-01Use IntrusiveForwardList<> for Env-/UsePosition.Vladimir Marko
Test: m test-art-host-gtest Test: testrunner.py --host Change-Id: I2b720e2ed8f96303cf80e9daa6d5278bf0c3da2f
2017-05-15Min/max SIMDization support.Aart Bik
Rationale: The more vectorized, the better! Test: test-art-target, test-art-host Change-Id: I758becca5beaa5b97fab2ab70f2e00cb53458703
2017-04-20ARM64: Support MultiplyAccumulate for SIMD.Artem Serov
Test: test-art-host, test-art-target. Change-Id: I06af8415e15352d09d176cae828163cbe99ae7a7
2017-04-19Implement halving add idiom (with checker tests).Aart Bik
Rationale: First of several idioms that map to very efficient SIMD instructions. Note that the is-zero-ext and is-sign-ext are general-purpose utilities that will be widely used in the vectorizer to detect low precision idioms, so expect that code to be shared with many CLs to come. Test: test-art-host, test-art-target Change-Id: If7dc2926c72a2e4b5cea15c44ef68cf5503e9be9
2017-03-28Merge "Make data dependency around HDeoptimize correct."Nicolas Geoffray
2017-03-27Make data dependency around HDeoptimize correct.Nicolas Geoffray
We use HDeoptimize in a few places, but when it comes to data dependency we either: - don't have any (BCE, CHA), in which case we should make sure no code that the deoptimzation guards moves before the HDeoptimize - have one on the receiver (inline cache), in which case we can update the dominated users with the HDeoptimize to get the data dependency correct. bug:35661819 bug:36371709 test: 644-checker-deopt Change-Id: I4820c6710b06939e7f5a59606971693e995fb958
2017-03-23Implement a SIMD spilling slot.Aart Bik
Rationale: The last ART vectorizer break-out CL \O/ This ensures spilling on x86 and x86_4 is correct. Also, it paves the way to wider SIMD on ARM and MIPS. Test: test-art-host Bug: 34083438 Change-Id: I5b27d18c2045f3ab70b64c335423b3ff2a507ac2
2017-02-17ARM: Merge data-processing instructions and shifts/(un)signed extensionsAnton Kirilov
This commit mirrors the work that has already been done for ARM64. Test: m test-art-target-run-test-551-checker-shifter-operand Change-Id: Iec8c1563b035f40f0e18dcffde28d91dc21922f8
2017-01-15Revert "Revert "ART: Compiler support for invoke-polymorphic.""Orion Hodson
This reverts commit 0fb5af1c8287b1ec85c55c306a1c43820c38a337. This takes us back to the original change and attempts to fix the issues encountered: - Adds transition record push/pop around artInvokePolymorphic. - Changes X86/X64 relocations for MacSDK. - Implements MIPS entrypoint for art_quick_invoke_polymorphic. - Corrects size of returned reference in art_quick_invoke_polymorphic on ARM. Bug: 30550796,33191393 Test: art/test/run-test 953 Test: m test-art-run-test Change-Id: Ib6b93e00b37b9d4ab743a3470ab3d77fe857cda8
2017-01-11Revert "ART: Compiler support for invoke-polymorphic."Orion Hodson
This reverts commit 02e3092f8d98f339588e48691db77f227b48ac1e. Reasons for revert: - Breaks MIPS/MIPS64 build. - Fails under GCStress test on x64. - Different x64 build configuration doesn't like relocation. Change-Id: I512555b38165d05f8a07e8aed528f00302061001
2017-01-11ART: Compiler support for invoke-polymorphic.Orion Hodson
Adds basic support to invoke method handles in compiled code. Enables method verification for methods containing invoke-polymorphic. Adds k45cc/k45rc output to Instruction::DumpString() which was found to be missing when enabling verification. Include stack traces in test 957-methodhandle-transforms for failures so they can be easily identified. Bug: 30550796,33191393 Test: art/test/run-test 953 Test: m test-art-run-test Change-Id: Ic9a96ea24906087597d96ad8159a5bc349d06950
2016-10-18Remove mirror:: and ArtMethod deps in utils.{h,cc}David Sehr
The latest chapter in the ongoing saga of attempting to dump a DEX file without having to start a whole runtime instance. This episode finds us removing references to ArtMethod/ArtField/mirror. One aspect of this change that I would like to call out specfically is that the utils versions of the "Pretty*" functions all were written to accept nullptr as an argument. I have split these functions up as follows: 1) an instance method, such as PrettyClass that obviously requires this != nullptr. 2) a static method, that behaves the same way as the util method, but calls the instance method if p != nullptr. This requires using a full class qualifier for the static methods, which isn't exactly beautiful. I have tried to remove as many cases as possible where it was clear p != nullptr. Bug: 22322814 Test: test-art-host Change-Id: I21adee3614aa697aa580cd1b86b72d9206e1cb24
2016-09-23Clean-up sharpening and compiler driver.Nicolas Geoffray
Remove dependency on compiler driver for sharpening and dex2dex (the methods called on the compiler driver were doing unnecessary work), and remove the now unused methods in compiler driver. Also remove test that is now invalid, as sharpening always succeeds. test: m test-art-host m test-art-target Change-Id: I54e91c6839bd5b0b86182f2f43ba5d2c112ef908
2016-08-19ART: Add thread offset printing hook to disassemblerAndreas Gampe
To prepare separation of disassembler from libart, add a function hook to the disassembler options for thread offset name printing. Bug: 15436106 Change-Id: I9e9b7e565ae923952c64026f675ac527b560f51b
2016-08-02Improve the graph visualizer's output for constant locations.Alexandre Rames
Change-Id: I423fb378ee61fb53c3b328fc74f4e95cdef0992a
2016-07-15Rename current register allocator implementationMatthew Gharrity
This will allow a cleaner commit in an upcoming refactoring of register allocation. Test: m test-art-host Change-Id: If420c97b088b3c934411ff83373e024003120746
2016-07-13X86: Use memory to do array range checksMark Mendell
Currently, an HBoundsCheck is fed by an HArrayLength, causing a load of the array length, followed by a register compare. Avoid the load when we can by comparing directly with the array length in memory. Implement this by marking the HArrayLength as 'emitted at use site', and then generating the code in the HBoundsCheck. Only do this replacement when we are the only user of the ArrayLength and it isn't visible to the environment. Handle the special case where the array is 'null' and where an implicit null check can't be eliminated. This code moves the load of the length to the slow code for the failed check, which is what we want. Test: 609-checker-x86-bounds-check Change-Id: I9cdb183301e048234bb0ffeda940eedcf4a655bd Signed-off-by: Mark Mendell <mark.p.mendell@intel.com>