| Age | Commit message (Collapse) | Author |
|
If nothing can throw within a TryBoundary, we are safe to eliminate
it. We were already doing this at the builder stage, but this CL
takes care of subsequent passes (e.g. we might remove DivZeroCheck
instructions which means that now we know we can't throw).
Sometimes this means we are able to eliminate catch blocks which
brings some code size improvements.
Locally on a Pixel 5 compiling with `speed`:
* AGSA -684K (0.2%)
* services.jar -100K (0.2%)
* SystemUIGoogle -88K (0.3%)
Bug: 229249867
Test: art/test/testrunner/testrunner.py --host --64 --optimizing -b
Change-Id: I36d5880be99c1f1109c94266b1be583de8d6cf72
|
|
This reverts commit 0a51605ddd81635135463dab08b6f7c21b58ffb0.
Reason for revert: Reland after some of the required work
was merged in other CLs.
Also address a TODO from the original CL to mark required
symbols with EXPORT in `intrinsic_objects.h`.
Also mark symbols in new files as HIDDEN.
Bug: 186902856
Test: m test-art-host-gtest
Test: testrunner.py --host --optimizing
Change-Id: I936d448983928af23614ca82c2d0bf9a645e2c52
|
|
Notable changes:
1) Wiring of the graph now allows for inlinees graph ending in
TryBoundary, or Goto in some special cases.
2) Building a graph with try catch for inlining may add an extra
Goto block.
3) Oat version bump.
4) Reduced kMaximumNumberOfCumulatedDexRegisters from 32 to 20.
Bug: 227283224
Test: art/test/testrunner/testrunner.py --host --64 --optimizing -b
Change-Id: Ic2fd956de24b72d1de29b4cd3d0b2a1ddab231d8
|
|
We now consider the edge case where the dead instruction we wanted to
remove was used in a phi which is not directly following the block
we are processing right now. To fix this, we process all blocks
before trying to remove the instructions.
As a note, we remove catch phi uses right before removing the
instruction as they are related to the instruction itself and not
the block hierarchy.
Test: art/test/testrunner/testrunner.py --host --64 --optimizing -b
Test: dex2oat compiling locally the apps mentioned in the bug
Bug: 239519319
Change-Id: I70d47891203ae118851a1f20a7cee21de305cd61
|
|
We now remove the instructions to free up memory. We have to refactor
methods a little bit to avoid removing instructions as users twice,
since we do not support that.
Test: art/test/testrunner/testrunner.py --host --64 --optimizing -b
Change-Id: Ia34c4a6af204952d295e5a2cb534115ced97ab07
|
|
This reverts commit fa1034c563b44c4f557814c50e2678e14dcd1d13.
Reason for revert: Relanding after float/double fix. In short,
don't deal with floats/doubles since they bring a lot of edge cases e.g.
if (f == 0.0f) {
// f is not guaranteed to be 0.0f, e.g. it could be -0.0f.
}
Bug: 240543764
Change-Id: I400bdab71dba0934e6f1740538fe6e6c0a7bf5fc
|
|
This reverts commit c6b816ceb2b35300c937ef2e7d008598b6afba21.
Reason for revert: Broke libcore test https://ci.chromium.org/ui/p/art/builders/ci/angler-armv7-ndebug/3179/overview
Change-Id: I4f238bd20cc485e49078104e0225c373cac23415
|
|
We have knowledge of the value of some variables at compile time due
to the fact they are used in if clauses. For example:
if (variable == constant) {
// SSA `variable` guaranteed to be equal to constant here.
} else {
// No guarantees can be made here (except for booleans since
// they only have two values).
}
Similarly with `variable != constant`.
We can also apply this to boolean parameters e.g.
void foo (boolean val) {
if (val) {
// `val` guaranteed to be true here.
...
}
...
}
Test: art/test/testrunner/testrunner.py --host --64 --optimizing -b
Change-Id: I55df0252d672870993d06e5ac92f5bba44d902bd
|
|
When we remove a dead block, we update its successor's phis (as long
as the successor is still reachable). We can reuse code from
DisconnectAndDelete if we refactor it a little bit.
Bug: 240546614
Fixes: 240546614
Test: art/test/testrunner/testrunner.py --host --64 --optimizing -b
Change-Id: I70c509bd1c9e392118bbf95c7aaac64faa46237f
|
|
Allow SimplifyAlwaysThrows to run on any invoke that always throws,
and not just the second to last instruction.
As a bonus, there are two places that would make a graph have
invokes that always throws:
1) When inlining a method that has invokes that always throw.
2) When trying to inline a method, and not doing it since it
always throws.
Since we only have those two places, we can add a flag to the graph
that tracks this. We then skip the SimplifyAlwaysThrows optimization
altogether if the graph doesn't have that flag set.
Bug: 227316307
Test: art/test/testrunner/testrunner.py --host --64 --optimizing -b
Change-Id: Ia353fcf2c055885cc04e10790584210c2e488e32
|
|
loops with a low trip count."
This change removes SuspendCheck for plain loops with a low trip count.
The SuspendCheck in the codegen makes sure that the thread can be
interrupted during execution for GC. Not being able to do so might
decrease the responsiveness of GC in the case when a very long loop
or a long recursion is being executed.
However, for plain loops with a small trip count, the removal of
SuspendCheck should not affect the GC's responsiveness by a large
margin. Consequently, since the thread won't be interrupted for
plain loops, it is assumed that the performance might increase
by removing SuspendCheck.
Also add explicit checks to existing code to ensure that SuspendCheck
is never null when it is used.
This reverts commit 8f6b99fba2d043265a84d599a967d52f66738ad6
Reason for revert: Included fix for CHAGuardVisitor::HoistGuard crash
by disabling codegen for optimized SuspendCheck nodes instead of
removing the SuspendCheck node itself.
Test: art/test.py -v -j12 --host --64 -t 2233-checker\
-remove-loop-suspend-check --run-test --optimizing
Change-Id: Id6296aded91e1cf49b8f3f339dc83613cbedf876
|
|
Instead of `in_body`, propagate the context block and loop
information to make better decisions for trip count if the
context is outside the loop.
In particular, fix `InductionVarRange::IsConstant()` to take
and use this information instead of assuming that we are
asking about values in the loop body.
For trip count with context outside the loop, we know that
the value shall be the maximum trip count if the context
is dominated by the loop control exit block.
Test: Enable run-test 835-b216762268.
Test: m test-art-host-gtest
Test: testrunner.py --host --optimizing
Bug: 216762268
Change-Id: Id564ba75c812d54abdd9b229e643cc8ab4701c52
|
|
Follow-up to aosp/1988868 in which we added the (D)CHECK_IMPLIES
macro. This CL uses it on compiler/ occurrences found by a regex.
Test: art/test/testrunner/testrunner.py --host --64 --optimizing -b
Change-Id: If63aed969bfb8b31d6fbbcb3bca2b04314c894b7
|
|
It needs access to a code generator.
Test: observe a bogus graph at the point of register allocator, and see
that the Dump method crashes.
Change-Id: I09a847246428fd3bd0938f9f457773c465da253d
|
|
This reverts commit 72be14ed06b76cd0e83392145cec9025ff43d174.
Reason for revert: A reland of
commit 2d4feeb67912d64b9e980e6687794826a5c22f9d with a fix for no-image
tests
Change-Id: I79f719f0d4d9b903db301a1636fde5689da35a29
|
|
This reverts commit 2d4feeb67912d64b9e980e6687794826a5c22f9d.
Reason for revert: This breaks no-image tests. Example failure: https://android-build.googleplex.com/builds/submitted/7871904/art-no-image/latest/view/logs/build_error.log
Change-Id: I0f97c672c2d48f125931171ee1041a7c1cf20127
|
|
The idea of this CL is to avoid maintaining the instrumentation stack
and manipulating the return addresses on the stack to call the entry /
exit hooks. This Cl only addresses this for JITed code. In follow up
CLs, we will extend this to others (native, nterp). Once we have
everything in place we could remove the complexity of instrumentation
stack.
This CL introduces new nodes (HMethodEntry / HMethodExit(Void)) that
generate code to call the trace entry / exit hooks when
instrumentation_stubs are installed. Currently these are introduced for
JITed code in debuggable mode. The entry / exit hooks roughly do the
same this as instrumentation entry / exit points.
We also extend the JITed frame slots by adding a ShouldDeoptimize slot.
This will be used to force deoptimization of frames when requested by
jvmti (for ex: structural re-definition).
Test: art/testrunner.py
Change-Id: Id4aa439731d214a8d2b820a67e75415ca1d5424e
|
|
Test: New tests in load_store_elimination_test.
Test: New test in 539-checker-lse.
Test: m test-art-host-gtest
Test: testrunner.py --host --optimizing
Bug: 187487955
Change-Id: Iff66d5406cf1b36c3bebbce1d48117f83bb50553
|
|
Fix braino from
https://android-review.googlesource.com/1570261 .
Test: m test-art-host-gtest
Test: testrunner.py --host --optimizing
Bug: 172573708
Bug: 180527726
Change-Id: I430d3e7034a3f600674763986a324d80903aaf6c
|
|
Test: Added tests to 122-npe and 160-read-barrier-stress
Test: m test-art-host-gtest
Test: testrunner.py --host --optimizing
Test: run-gtests.sh
Test: testrunner.py --target --optimizing
Bug: 172573708
Change-Id: I8342510565289058df218d3249ffac1eb993ca4f
|
|
Include helpers for printing arguments as well.
Test: ./test.py --host
Change-Id: I692fd5bd32a8a39da0defd9454d56ccf2480f229
|
|
Allow printing individual instruction and its arguments with
the HGraphVisualizer. Arguments are dumped "recursively"
(but implemented with a queue instead of actual recursion).
For example, printing the Return instruction from the method
Main.testLoop17 in 530-checker-lse yields
v28 Return [i27] dex_pc:23 loop:none
i27 Add [i24,i26] dex_pc:22 loop:none
i24 Phi [i5,i15] dex_pc:n/a reg:0 is_catch_phi:false loop:none
i5 IntConstant dex_pc:0 1 loop:none
i15 IntConstant dex_pc:5 2 loop:none
i26 InstanceFieldGet [l6] dex_pc:20 field_name:TestClass.i field_type:Int32 loop:none
l6 NullCheck [l1] dex_pc:1 env:[[i5,_,_,l1,i2]] loop:none
l1 ParameterValue dex_pc:n/a loop:none
Test: Manual; modify LSE to print the instruction above.
Change-Id: Iaf41ba62cd6a5a36236ad0abca082ebffcf6a20e
|
|
The ClearLoopInformation call used to use the RPO list to find
blocks which potentially had loop-information. This meant that if one
was also clearing the dominance information (which is quite common)
one needed to be sure to call ClearLoopInformation before calling
ClearDominanceInformation or else loop information will not be fully
cleared. This could cause quite perplexing errors if dominance
information is recomputed later (also quite common). This error is in
fact present in several tests (none of which use loops which is how it
got missed).
Fix this issue by just looping over all blocks. Also add a new
GetActiveBlocks function which does the filtering of null blocks
automatically. In many cases (such as these) we use RPO purely because
it doesn't require filtering. This should be able to replace these
uses.
Test: ./test.py --host
Change-Id: I60c7defc409111471064e9bf02b7ae3a0eb10584
|
|
We incorrectly handled merging unknowns in some situations.
Specifically in cases where we are unable to materialize loop-phis we
could end up with PureUnknowns which could end up hiding stores that
need to be kept.
In an unrelated issue we were incorrectly considering some values as
escapes when live at the point of an invoke. Since
SearchPhiPlaceholdersForKeptStores used a more precise notion of
escapes we could end up removing stores without being able to replace
the values.
This reverts commit 2316b3a0779f3721a78681f5c70ed6624ecaebef.
This unreverts commit b6837f0350ff66c13582b0e94178dd5ca283ff0a
This reverts commit fe270426c8a2a69a8f669339e83b86fbf40e25a1.
This unreverts commit bb6cda60e4418c0ab557ea4090e046bed8206763.
Bug: 67037140
Bug: 173120044
Reason for revert: Fixed issue causing incorrect store elimination
Test: ./test.py --host
Test: Boot cuttlefish
atest FrameworksServicesTests:com.android.server.job.BackgroundRestrictionsTest#testPowerWhiteList
Change-Id: I2ebae9ccfaf5169d551c5019b547589d0fce1dc9
|
|
This reverts commit b6837f0350ff66c13582b0e94178dd5ca283ff0a
This unreverts commit fe270426c8a2a69a8f669339e83b86fbf40e25a1.
This rereverts commit bb6cda60e4418c0ab557ea4090e046bed8206763.
Bug: 67037140
Bug: 173120044
Reason for revert: Git-blame seems to point to the CL as cause of
b/173120044. Revert during investigation.
Change-Id: I46f557ce79c15f07f4e77aacded1926b192754c3
|
|
A ScopedArenaAllocator in a single test was accidentally loaded using
operator new which is not supported. This caused a memory leak.
This reverts commit fe270426c8a2a69a8f669339e83b86fbf40e25a1.
This unreverts commit bb6cda60e4418c0ab557ea4090e046bed8206763.
Bug: 67037140
Reason for revert: Fixed memory leak in
LoadStoreAnalysisTest.PartialEscape test case
Test: SANITIZE_HOST=address ASAN_OPTIONS=detect_leaks=0 m test-art-host-gtest-dependencies
Run art_compiler_tests
Change-Id: I34fa2079df946ae54b8c91fa771a44d56438a719
|
|
This reverts commit bb6cda60e4418c0ab557ea4090e046bed8206763.
Bug: 67037140
Reason for revert: memory leak detected in the test.
Change-Id: I81cc2f61494e96964d8be40389eddcd7c66c9266
|
|
This is the first piece of partial LSE for art. This CL adds analysis
tools needed to implement partial LSE. More immediately, it improves
LSE so that it will remove stores that are provably non-observable
based on the location they occur. For example:
```
Foo o = new Foo();
if (xyz) {
check(foo);
foo.x++;
} else {
foo.x = 12;
}
return foo.x;
```
The store of 12 can be removed because the only escape in this method
is unreachable and was not executed by the point we reach the store.
The main purpose of this CL is to add the analysis tools needed to
implement partial Load-Store elimination. Namely it includes tracking
of which blocks are escaping and the groups of blocks that we cannot
remove allocations from.
The actual impact of this change is incredibly minor, being triggered
only once in a AOSP code. go/lem shows only minor effects to
compile-time and no effect on the compiled code. See
go/lem-allight-partial-lse-2 for numbers. Compile time shows an
average of 1.4% regression (max regression is 7% with 0.2 noise).
This CL adds a new 'reachability' concept to the HGraph. If this has
been calculated it allows one to quickly query whether there is any
execution path containing two blocks in a given order. This is used to
define a notion of sections of graph from which the escape of some
allocation is inevitable.
Test: art_compiler_tests
Test: treehugger
Bug: 67037140
Change-Id: I0edc8d6b73f7dd329cb1ea7923080a0abe913ea6
|
|
The compiled code and runtime stubs don't need to have direct access to
the dex cache anymore.
Test: test.py
Change-Id: Id3aab9b10445ba2599e1a9ffd8e36506a745bfec
|
|
If a float or double argument needs to be passed in core
register to a @CriticalNative method due to soft-float
native ABI, insert a fake call to Float.floatToRawIntBits()
or Double.doubleToRawLongBits() to satisfy type checks in
the compiler.
We cannot do that for intrinsics that expect those inputs in
actual FP registers, so we still prevent such intrinsics
from using `kCallCriticalNative`. This should be irrelevant
if an actual intrinsic implementation is emitted. There are
currently two unimplemented intrinsics that are affected by
the carve-out, namely MathRoundDouble and FP16ToHalf, and
four intrinsics implemented only when ARMv8A is supported,
namely MathRint, MathRoundFloat, MathCeil and MathFloor.
Test: testrunner.py --target --32 -t 178-app-image-native-method
Bug: 112189621
Change-Id: Id14ef4f49f8a0e6489f97dc9588c0e6a5c122632
|
|
This commit prepares the ground for adding VarHandle support
in the compiler. The intrinsic locations builder and code
generator are now triggered for HInvokePolymorphic nodes.
VarHandle and MethodHandle intrinsics are marked as unimplemented
rather than unreachable.
Since the Varhandle intrinsics are not implemented yet, the
functionality is not changed (i.e. the intrinsics are evaluated
at runtime and not compiled). I manually tested that the intrinsic
Visit* methods are triggered for the VarHandle methods.
Bug: b/65872996
Test: art/test.py --host -r -t 713-varhandle-invokers
Test: art/test.py --host --all-compiler -r
Change-Id: I3333728c5f16d8dc4f92ceae2738ed59b3e31e6a
|
|
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
|
|
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
|
|
This avoids passing the `VariableSizedHandleScope*` argument
around and eliminates HGraph::inexact_object_rti_ and its
initialization. The latter shall allow running Optimizing
gtests that do not require type information without creating
a Runtime in future. (To be implemented in a separate CL.)
Test: m test-art-host-gtest
Test: testrunner.py --host --optmizing
Test: aosp_taimen-userdebug boots.
Change-Id: I36fe9bc556c6d610d644c8c14cc74c9985a14d64
|
|
Make it possible to include the definition of enum ClassRoot
without pulling in a lot of other headers.
Test: m test-art-host-gtest
Test: testrunner.py --host --optimizing
Test: aosp_taimen-userdebug boots.
Change-Id: Ic90fdd70bfe0c5428a5c9a0d7901ea7e15b03488
|
|
kPrimIntMax and kPrimLongMax are too large in value to be precisely
represented by IEEE 754 single and double precision, respectively.
The code in question is clamping the `value` to the above kConstants.
In this case, the imprecision doesn't result in logical errors. Accept
the imprecision via explicit cast.
Fixes:
art/compiler/optimizing/nodes.cc:1597:22: error: implicit conversion
from 'const int32_t' (aka 'const int') to 'float' changes value from
2147483647 to 2147483648 [-Werror,-Wimplicit-int-float-conversion]
if (value >= kPrimIntMax)
~~ ^~~~~~~~~~~
art/compiler/optimizing/nodes.cc:1605:22: error: implicit conversion
from 'const int64_t' (aka 'const long') to 'float' changes value from
9223372036854775807 to 9223372036854775808
[-Werror,-Wimplicit-int-float-conversion]
if (value >= kPrimLongMax)
~~ ^~~~~~~~~~~~
art/compiler/optimizing/nodes.cc:1629:22: error: implicit conversion
from 'const int64_t' (aka 'const long') to 'double' changes value from
9223372036854775807 to 9223372036854775808
[-Werror,-Wimplicit-int-float-conversion]
if (value >= kPrimLongMax)
~~ ^~~~~~~~~~~~
Bug: 139945549
Test: mm
Change-Id: I60582c13cfaceb6c6b217e13d7e9bd04d94874fe
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
|
|
This reverts commit e2727154f25e0db9a5bb92af494d8e47b181dfcf.
Reason for revert: Breaks ASAN tests (ODR violation).
Bug: 142365358
Change-Id: I38103d74a1297256c81d90872b6902ff1e9ef7a4
|
|
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
|
|
It can be called in a situation where dead blocks can have phis:
the DCE pass would re-build the dominator tree and RemoveInstructionsAsUsersFromDeadBlocks
used to assume there cannot be phis.
Test: 695-simplify-throws
Bug: 131174581
Change-Id: I853956482487a8c7c8fb99499aef318d099754e4
|
|
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
|
|
Handles compiler.
Bug: 116054210
Test: WITH_TIDY=1 mmma art
Change-Id: I5cdfe73c31ac39144838a2736146b71de037425e
|
|
Bug: http://b/111067277
Test: builds
Change-Id: I8b69ea3815e14bb6eb27f40c0dd01a85b340a355
|
|
Remove over-broad use in headers. Fix up transitive includes.
Bug: 119869270
Test: mmma art
Change-Id: I518fa7c8bee014b260818fca1fbde6ec47d126da
|
|
Instead just recognize the intrinsic when creating an invoke
instruction.
Also remove some old code related to compiler driver sharpening.
Test: test.py
Change-Id: Iecb668f30e95034970fcf57160ca12092c9c610d
|
|
When the instruction does not dominate the phi, but the instruction
that it is replacing does by being an input, do the replacement.
It was a missed improvement opportunity before, but the String.<init>
handling in the builder needs it for correctness.
bug: 111758226
Test: 563-checker-fakestring
Change-Id: I37f01e1aabc2a1f60e21fc57728f07248adbc946
|
|
Change sharpening to use PIC load kinds for AOT compilation
and add "Jit" to the direct addressing load kind names. Use
PIC code also for the Integer.valueOf() intrinsic codegen.
Remove all support for non-PIC linker patches.
The dex2oat --compile-pic option is retained for now but
ignored by the compiler.
Test: m test-art-host-gtest
Test: testrunner.py --host --optimizing
Test: Pixel 2 XL boots.
Test: testrunner.py --target --optimizing
Bug: 77856493
Change-Id: I54d666f6522f160a1b6ece4045a15d19363acbb6
|
|
When compiling debuggable code we would compile a new-instance String
instruction into a StringFactory.newEmptyString invoke. This
additional invoke could be observed using tracing and is inconsistent
with the interpreter, where the string is simply allocated directly.
In order to bring these two modes into alignment we added a new
AllocStringObject quick entrypoint that will be used instead of the
normal AllocObject<...> entrypoints when allocating a string. This
entrypoint directly allocates a new string in the same manner the
interpreter does.
Needs next CL for test to work.
Bug: 110884646
Test: ./test/testrunner/testrunner.py --host --runtime-option=-Xjitthreshold:0 --jit
Test: Manual inspection of compiled code.
Change-Id: I7b4b084bcf7dd9a23485c0e3cd2cd04a04b43d3d
|
|
We wrongly assumed only irreducible loops could lead
to this situation, but any loop can actually be in between
a String NewInstance and a String.<init>.
bug: 109666561
Test: 563-checker-fakestring
Change-Id: I018a22f7e22c15e140252544415f51d544f7cc13
|
|
Support BoundType instruction treatment in GVN.
Note: BoundType must not be a subject to LICM as it must not be
moved from more control dependent basic blocks to less control
dependent (e.g. hoisted out from the loop) due to semantics of
bounding the type.
Test: 477-checker-bound-type.
Test: test-art-target, test-art-host.
Change-Id: I64263d6ec7d9ad75d1fb07d3a89e9973be67682b
|
|
* changes:
Remove static_class_ from Method/VarHandle and CallSite.
Remove PrimitiveArray<T>::array_class_.
Refactor ClassRoot/GetClassRoot().
|