summaryrefslogtreecommitdiff
path: root/compiler/optimizing
AgeCommit message (Collapse)Author
2024-10-22Optimizing: Clean up graph visiting. Vladimir Marko
Change `PrepareForRegisterAllocation` to `HOptimization` and use a helper visitor class. Make some visitor classes final. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Bug: 181943478 Change-Id: I87700b92e06ff1a6cf7cd8a1e3ab8b7a87568dae
2024-10-21Remove unused variables. Christopher Ferris
Test: Builds with -Wunused-variable Change-Id: Ie308b9f1d7a092c67ab2d86d3f877fe5b59fdac4
2024-10-17fix inliner bug wangmingming1
I see field index of a class member variable is 0xFFFF which will cause TryPatternSubstitution throw away the iput-xxx instruction ```code void zyb.<init>(com.mi.fitness.netproxy.NetProxyManager) (dex_method_idx=20258) DEX CODE: 0x0000: 7010 273f 0000 | invoke-direct {v0}, void java.lang.Object.<init>() // method@16167 0x0003: 5b01 ffff | iput-object v1, v0, Lcom/mi/fitness/netproxy/NetProxyManager; zyb.a // field@65535 0x0005: 0e00 | return-void ``` Bug: 368471540 Test: the above bug doesn't reproduce Change-Id: I6bee31e07e17982e00e0e22d476a36f554081c3d Signed-off-by: wangmingming1 <wangmingming1@xiaomi.com>
2024-10-17Revert^2 "Add intrinsics for the absolute forms of unsafe.{get,put}Int" Shai Barack
This reverts commit c1bd4376b18ff46e5156cc597bd3311dd86fabd9. Reason for revert: fixed original root cause for breakage Change-Id: Ic9c214ebd691abf7f163b6399e8a94fc6f277ea0
2024-10-15Remove unused variable. Christopher Ferris
Test: Builds with -Wunused-variable Change-Id: I4ecca28528cd146b5b60fccc8f378bbbfe185a8f
2024-10-15Arm64: fix VecPredToBoolean code generation for SVE Konstantin Baladurin
This patch fixes code generation for VecPredToBoolean so it updates conditional flags itself based on its predicate input. Prior to this patch, code generation for VecPredToBoolean (incorrectly) implicitly assumed that the conditional flags were always updated by its input HIR (VecPredWhile) and that it immediately followed that HIR. Authors: Konstantin Baladurin <konstantin.baladurin@arm.com> Chris Jones <christopher.jones@arm.com> Test: env ART_FORCE_TRY_PREDICATED_SIMD=true art/test.py --target --optimizing Test: art/tools/run-gtests.sh Change-Id: Id4c2494cdefd008509f9039e36081151aaf0e4a6
2024-10-15Verify hardware supports ISA features in tests Chris Jones
When running codegen tests, verify that the ISA features used in the codegen are supported by the hardware. This strengthens checks for gtests that may use ISA features which are not supported by the hardware and therefore should not be run on that hardware. Test: art/test.py --gtest art_compiler_tests Change-Id: I56ebd6e964947fe004f466010a18faceb019bfae
2024-10-15Arm64: Fix PackedSwitch codegen for large methods. Artem Serov
This patch fixes a bug in arm64 PackedSwitch code generation for very large methods where we exceeded the range of Adr instruction - jump tables were emited in the very end of the method. Instead we now emit the jump table in-place as part of the PackedSwitch visitor - in the same way how it is done in arm32 backend. This patch also removes an incorrect assumption that the size of a method has a linear dependency on the number of its HIR instructions. This was used to choose whether to emit a jump table for a PackedSwitch. Test: art/test.py --target --host --optimizing Test: art/test.py --gtest art_compiler_tests Change-Id: I0795811a6408a25021879ab6be9e23ef5f1f50e4
2024-10-14Fix typo in CodeGenerator::Compile Santiago Aboy Solanes
Change-Id: I795216915b1770371c7c9492dde0183ced225ca0
2024-10-11Revert "Add intrinsics for the absolute forms of unsafe.{get,put}Int" Santiago Aboy Solanes
This reverts commit bcb5c19e5e200607fe76294aeb5273ddac5f04ae. Bug: 370098695 Reason for revert: Breaks LUCI builds for arm https://ci.chromium.org/ui/p/art/builders/ci/angler-armv7-non-gen-cc/4506/overview Change-Id: Ia72938c65c45db0ccd14f8901e715a9ec2930087
2024-10-11Refactor `HandleCache` out of `nodes.{h,cc}`. Vladimir Marko
Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Change-Id: I4989657309b46c1e8fec3e9eb4024f1fc329fbe0
2024-10-11Move `HCondition` creation function to `HCondition`. Vladimir Marko
Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Change-Id: Ibf7d27af872bf0bc9a91d1698d66047947b513f3
2024-10-11Do not record dex PC in constant HIR. Vladimir Marko
Due to the dedplication of constants, the dex PC can be useless or even misleading. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Change-Id: I501abc3cca920415b3118e92b06a01b173b2406a
2024-10-11Add intrinsics for the absolute forms of unsafe.{get,put}Int Shai Barack
Praise the Absolute! 🦑 Bug: 370098695 Change-Id: Icd0435c33a7a3705674eb2e3b027056a6c1298ba Tested: UnsafeTest Tested: manually inspected output disassembly
2024-10-11Refactor `ReferenceTypeInfo` out of `nodes.{h,cc}`. Vladimir Marko
Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Change-Id: I0c2f310606bb03f264038534c23f15dd0fee5662
2024-10-08Remove extra LOG(FATAL)+Unreachable Santiago Aboy Solanes
All cases are defined so they are not needed. Bug: 328756212 Change-Id: I750b2d75469f516f3d9b244610c217b0c11b3673
2024-10-07Address comments from aosp/3282234 Santiago Aboy Solanes
Follow up to aosp/3282234 regarding comments after submission. Bug: 362916226 Test: art/test/testrunner/testrunner.py --host --64 --optimizing -b Change-Id: Id572dd42e5aa877f4ae4a20cd43ad7a778e92815
2024-10-07Reland "Calculate the number of out vregs." Vladimír Marko
This reverts commit 434a327234f74eed3ef4072314d2e2bdb73e4dda. Reason for revert: Relanding with no change. The regressions that were the reason for the revert may reappear. However, these regressions are probably caused by subtle effects that are not directly related to this change. For example, a code size improvement can regress performance simply by moving the start of a loop from an aligned address to an unaligned address, or by splitting a loop across two cache lines. Bug: 358519867 Bug: 359722268 Change-Id: I997b8a4219418f79b3a5fc4e7e50817911f0a737
2024-10-04Revert "Avoid move to same registers." Nicolas Geoffray
This reverts commit 6cb63acdff440bb7573091e05d64b09cf0afda7c. Reason for revert: b/371488856 Change-Id: I962f00da097de062ee288ff7a7ce618482109a93
2024-10-04Reduce memory used by `HEnvironment`. Vladimir Marko
Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Bug: 181943478 Change-Id: Ie05d4001e411a669e11b8edda375414e5da52ae2
2024-10-03Avoid move to same registers. Nicolas Geoffray
We do always use ints as W registers. Test: test.py Change-Id: I9743edf2fd7bacba036b41fda42bdd539264a73c
2024-09-30Revert^5 "Object.clone() allocates more movable objects" Nicolas Geoffray
This reverts commit ea269f69d05fe333e4b36634b925c3c40fc8ce95. Bug: 355291033 Bug: 354087169 Bug: 360363656 Bug: 361327909 Bug: 364629185 Reason for revert: Failure on asan: +addressOf succeeded on movable object +Unexpectedly got 0 address in checkMovable Change-Id: I1f27845bf3fb7a1542f24b943d999f2d4da5e23a
2024-09-26Revert^4 "Object.clone() allocates more movable objects" Hans Boehm
This reverts commit fc0ed57a5f25d8a7b3fbf200224bd880ed05eff5. PS1 is identical to aosp/3231043 PS2 adds 2280-address-of test, re-allows non-movable objects to be allocated in LOS, and more generally tracks non-movable objects in other spaces. PS3 Style tweak PS4 Disable test on jvm Bug: 355291033 Bug: 354087169 Bug: 360363656 Bug: 361327909 Bug: 364629185 Test: Build and boot AOSP Test: testrunner.py --host -b --all-gc -t 2280-address-of Change-Id: I4b2929c353a6ede916762de509056817f001d6f8
2024-09-25Revert^2 "Add VarHandle implementations for void getAndUpdate methods" Santiago Aboy Solanes
This reverts commit 8567fcdf972ade85785b689a15e3593a7d3bff9d. Reason for revert: RISC-V fix Test: LUCI run for RISC-V Change-Id: I6392bfa045e7737b5c45d78da4f7ecb8fbd3b89a
2024-09-25Revert "Add VarHandle implementations for void getAndUpdate methods" Ulya Trofimovich
This reverts commit 9ff2b617341bfe574e2d8706553f0cd65a1a2fc8. Reason for revert: failed ART test 712-varhandle-invocations on riscv64 `F dex2oat64: intrinsics_riscv64.cc:4821 Check failed: locations->GetTempCount() == 2u (locations->GetTempCount()=3, 2u=2)` Change-Id: I68a3830ccd730afa66e9cff277fe2a06829ddabe
2024-09-24x86_64: remove subtype check from invoke-virtual fast path. Almaz Mingaleev
After aosp/3248173 and aosp/3250172 a MH object with invoke-virtual kind can target only virtual methods. As there is callsite check against MH type no receiver checks are needed. That's in line with JVMS 4.4.8. Bug: 297147201 Test: ./art/test/testrunner/testrunner.py --host --64 --optimizing -b Test: ./art/test.py --host -g Test: CtsLibcoreTestCases Test: CtsLibcoreOjTestCases Change-Id: I2c12760a75b83ddf7cc21d34bcc8bb58621e6cca
2024-09-24Add VarHandle implementations for void getAndUpdate methods Santiago Aboy Solanes
We were missing to intrinsify getAndUpdate methods whose value was unused. By adding this support, they get a considerable runtime improvement. Bug: 362916226 Test: art/test/testrunner/testrunner.py --host --64 --optimizing -b Test: art/test/testrunner/testrunner.py --host --32 --optimizing -b Test: art/test/testrunner/testrunner.py --target --64 --optimizing Test: art/test/testrunner/testrunner.py --target --32 --optimizing Change-Id: I63d5a897ac9ea3c133167ac186afd8595f75bb13
2024-09-24x86_64: Handle invoke-static in invokeExact fast path. Almaz Mingaleev
Bug: 297147201 Test: ./art/test/testrunner/testrunner.py --host --64 --optimizing -b Test: ./art/test.py --host -g Change-Id: Ia49285c116e4abfc3da2d78495f85d9131f111b5
2024-09-20Check receiver for null in invokeExact intrinsic. Almaz Mingaleev
Bug: 297147201 Test: ./art/test/testrunner/testrunner.py --host --64 --optimizing --jvm -b Change-Id: I6633bdab20b13335afccfe0506f6b91391c19fe3
2024-09-13riscv64: Add node Rol, fix InstructionBuilder Anton Romanov
This reverts commit 744830cb242c82c4637e6fb303b36d0371c84979. Reason for revert: updated CHECKer test to use rolw instead of rol. Change-Id: I50e34c6ac69488a9c083f04c6382df4302e8e7d3
2024-09-11Revert "riscv64: Add node Rol, fix InstructionBuilder" Nicolas Geoffray
This reverts commit 39927bc359ccbe65371213c4559126b05dcfb117. Reason for revert: Failure on bot with: error: Statement could not be matched starting from line 1089612 TestRotate.java:95: rol {{a\d+}}, {{a\d+}}, {{a\d+}} ISA_FEATURES = {'rv64gcv_zba_zbb_zbs': True} READ_BARRIER_TYPE = baker 567-checker-builder-intrinsics FAILED: [run-test:1074] CFG checker failed $ ssh -q -F /b/s/w/ir/cache/builder/art/test/testrunner/ssh_config -p 10001 ubuntu@localhost "rm -rf /home/ubuntu/art-test-chroot/data/run-test/test-343039" 567-checker-builder-intrinsics files deleted from host and from target ---------- test-art-target-run-test-ndebug-prebuild-optimizing-no-relocate-ntrace-cms-checkjni-picimage-ndebuggable-no-jvmti-567-checker-builder-intrinsics64 Change-Id: Ic1fd87c331c9eba315af6c98c3ad393766327417
2024-09-10riscv64: Add node Rol, fix InstructionBuilder Anton Romanov
Add new IR node Rol (rotate left). This allows to generate 1 (one) risc-v instruction from Integer(Long).rotateLeft intrinsic instead of 2 instructions (Ror+Neg). Fix InstructionBuilder: build Rol from rotateLeft instead of Ror+Neg. Add unfolding of Rol node in InstructionSimplifier(Arm, Arm64 and X86 Int64 type) to Neg+Ror. By compiling with dex2oat all the methods of applications below I got: in Facebook 1 Ror+Neg pattern, in Minecraft 5 Ror+Neg patterns. Test: art/test/testrunner/testrunner.py --target --64 --ndebug --optimizing Change-Id: Ic28610c6fab4f66386f2fbc0f7223ef2c0e644b6
2024-09-10Improve Unsafe.get* code generation on arm64. Nicolas Geoffray
Test: 858-checker-unsafe Bug: 364963560 Change-Id: I9f7014be462e70931a650b58169b784238344546
2024-09-06Intrinsify Unsafe/JdkUnsafe.arrayBaseOffset. Nicolas Geoffray
Test: 858-checker-unsafe Bug: 364696334 Change-Id: I33dc18c80c1fdcb78bd708a8733ea35cb311710e
2024-09-03Revert^3 "Object.clone() allocates more movable objects" Pechetty Sravani (xWF)
This reverts commit 1956542906d0b128a86975af009ba4601d02129a. Reason for revert: Droid Monitor created revert due to this b/363849521. Change-Id: Ic56e46bc11b1fd696b82f29782a1d1735ee805a9
2024-09-02cleanup: change Set/GetIntrinsic in ArtMethod to use Intrinsics Santiago Aboy Solanes
Test: art/test/testrunner/testrunner.py --host --64 --optimizing -b Change-Id: I253a6bfe6bba7e02e527722c4632cb60938fe1c6
2024-09-02Typo fix: instrinsic -> intrinsic Santiago Aboy Solanes
Change-Id: I6116b792d156970cefc277d2ea6af05627917d09
2024-09-02Don't devirtualize to an intrinsic invalid after the builder phase Santiago Aboy Solanes
As a drive-by, print the intrisic itself and not its index in graph_checker.cc. Bug: 362091596 Test: Compile the app in the bug Change-Id: I55c857f193d334d1a40cac637dfedf6334522f00
2024-09-02Address follow-up comments from aosp/2721077. Almaz Mingaleev
Bug: 297147201 Test: ./art/test/testrunner/testrunner.py --host --64 -b --optimizing Change-Id: Ie89d310633339b785de5d9f3daf653abfbff875c
2024-09-02Optimizations on arm64 for Unsafe.put* Nicolas Geoffray
Generate better code if some of the inputs are constant. Bug: 362820038 Test: 858-checker-unsafe Change-Id: I263b48e0c60aa6c57cbb5ac2fdcf016e6cf83895
2024-08-30Revert^2 "Object.clone() allocates more movable objects" Hans Boehm
This reverts commit 7c89f49c2c542df1a5780fb851e2ef0e0909f48f. PS1 is identical to aosp/3200711. PS2 revises the approach a bit by continuing to allocate non-movable objects in LargeObjectsSpace, but tracking them explicitly in a renamed, and now lock-protected, data structure stray_non_movable_objects_, which explicitly tracks nonmovable objects in both zygote and large objects spaces. This was done after discovering that there are applications that allocate more than 64MB of mostly large DirectByteBuffers. Also modifies 070-nio-buffer to check that we can allocate lots of direct ByteBuffers. PS3-PS5 have minor tweaks (comments and slight code simplification). Bug: 355291033 Bug: 354087169 Bug: 360363656 Bug: 361327909 Test: Build and boot AOSP Test: testrunner.py --host -b --all-gc -t 070-nio-buffer Change-Id: Ia6948c516b30188934a644a3f8f788914dfabb2a
2024-08-28cleanup: Use AddRegisterTemps where appropriate Santiago Aboy Solanes
Test: art/test/testrunner/testrunner.py --host --64 --optimizing -b Change-Id: I2fc3cd539ee1f64d1757c3b2a0a532ff6e7366f7
2024-08-28x86_64: Add instrinsic for MethodHandle::invokeExact... Almaz Mingaleev
... which targets invoke-virtual methods. New entrypoint changes deliverException's offset, hence arm test change. Bug: 297147201 Test: ./art/test/testrunner/testrunner.py --host --64 -b --optimizing Test: ./art/test.py --host -g Change-Id: I636fc60c088bfdf9b695c92de47f1c539e3956f1
2024-08-28Add LSE gtests for inserting type conversions. Vladimir Marko
Add tests for the cases where the LSE correctly inserts the required type conversion instructions as needed, as well as tests for currently broken cases. The latter are guarded by `GTEST_SKIP()` until we fix them in a separate change. Test: m test-art-host-gtest Bug: 341476044 Change-Id: Id6002bc31cef542564b84258defcab45b06e6445
2024-08-28Remove remnants of Partial LSE. Vladimir Marko
Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Bug: 298176183 Change-Id: Ic8c1137ca8150c58d60191385c99beb909bdff9e
2024-08-27ART: Clean up environment construction in gtests. Vladimir Marko
Create required instruction environments in helper functions that create instructions. Test: m test-art-host-gtest Change-Id: Iacdd3c3717d95bc3e7fc3c1b676bc8eb70f2e6bc
2024-08-21Revert "Calculate the number of out vregs." Vladimír Marko
This reverts commit 3e75615ad25b6af1842b194e78b429b0f585b46a. Reason for revert: Regressed some micro-benchmarks, see bug 359722268. Bug: 358519867 Bug: 359722268 Change-Id: I207cc78c88193564e90c98eda2c96a5ba354a588
2024-08-21Print the intrinsic for all invokes when dumping the cfg Santiago Aboy Solanes
In particular, start printing the intrinsic for HInvokePolymorphic. There are several HInokvePolymorphic intrinsics (see ART_SIGNATURE_POLYMORPHIC_INTRINSICS_LIST) so it would be nice to get the information when the intrinsic are recongnized. Test: art/test/testrunner/testrunner.py --host --64 --optimizing -b Change-Id: I9e07bdfa7507a8c18c4fec7513c30fd343fe7140
2024-08-21Change `MakeCondition()` to take `IfCondition`... Vladimir Marko
... instead of the instruction type argument. And continue with loop construction cleanup in gtests. Test: m test-art-host-gtest Change-Id: I8cb83ae0c6d3cdb2a2ee4da0608cfeb69df722eb
2024-08-19Revert "Object.clone() allocates more movable objects" Hans Boehm
This reverts commit a5001fed23788c966fd87048d7f17ba8c0b51914. Reason for revert: b/360363656 Change-Id: Ibfea46976bb6434d728c69160edb5904ab7708aa