summaryrefslogtreecommitdiff
path: root/compiler/optimizing/optimizing_compiler.cc
Commit message (Collapse)AuthorAgeFilesLines
...
* ART: Refactor SsaBuilder for more precise typing infoDavid Brazdil2015-12-311-22/+29
| | | | | | | | | | | | | | | This reverts commit 68289a531484d26214e09f1eadd9833531a3bc3c. Now uses Primitive::Is64BitType instead of Primitive::ComponentSize because it was incorrectly optimized by GCC. Bug: 26208284 Bug: 24252151 Bug: 24252100 Bug: 22538329 Bug: 25786318 Change-Id: Ib39f3da2b92bc5be5d76f4240a77567d82c6bebe
* Dex2oat support for multiple oat file and image file outputs.Jeff Hao2015-12-231-1/+5
| | | | | | | | Multiple changes to dex2oat and the runtime to support a --multi-image option. This generates a separate oat file and image file output for each dex file input. Change-Id: Ie1d6f0b8afa8aed5790065b8c2eb177990c60129
* Merge "Revert "Tweak inlining heuristics.""Nicolas Geoffray2015-12-171-11/+1
|\
| * Revert "Tweak inlining heuristics."Nicolas Geoffray2015-12-171-11/+1
| | | | | | | | | | | | This reverts commit fcb7613d3aaa9a6802800b6e957aaad51cedf6dc. Change-Id: Idc0df6a2f68e8b5aa740bb1259f19c2953811510
* | Merge "Tweak inlining heuristics."Nicolas Geoffray2015-12-171-1/+11
|\|
| * Tweak inlining heuristics.Nicolas Geoffray2015-12-171-1/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | go/lem driven: Performance: Richards +41% CaffeineMethod +43% ReversiBench: +52% Towers: +73% Tak: +85% Memory use: 7% less memory CompileTime: 14% increase CodeSize: 8% increase Last three measures are now more acceptable given we JIT. Change-Id: Ic4aa6535d2b76cf3545ef00e9b2ae32330f10745
* | Revert "ART: Refactor SsaBuilder for more precise typing info"Alex Light2015-12-151-29/+22
|/ | | | | | | | | | | | | This reverts commit d9510dfc32349eeb4f2145c801f7ba1d5bccfb12. Bug: 26208284 Bug: 24252151 Bug: 24252100 Bug: 22538329 Bug: 25786318 Change-Id: I5f491becdf076ff51d437d490405ec4e1586c010
* ART: Refactor SsaBuilder for more precise typing infoDavid Brazdil2015-12-141-22/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch refactors the SsaBuilder to do the following: 1) All phis are constructed live and marked dead if not used or proved to be conflicting. 2) Primitive type propagation, now not a separate pass, identifies conflicting types and marks corresponding phis dead. 3) When compiling --debuggable, DeadPhiHandling used to revive phis which had only environmental uses but did not attempt to resolve conflicts. This pass was removed as obsolete and is now superseded by primitive type propagation (identifying conflicting phis) and SsaDeadPhiEliminiation (keeping phis live if debuggable + env use). 4) Resolving conflicts requires correct primitive type information on all instructions. This was not the case for ArrayGet instructions which can have ambiguous types in the bytecode. To this end, SsaBuilder now runs reference type propagation and types ArrayGets from the type of the input array. 5) With RTP being run inside the SsaBuilder, it is not necessary to run it as a separate optimization pass. Optimizations can now assume that all instructions of type kPrimNot have reference type info after SsaBuilder (with the exception of NullConstant). 6) Graph now contains a reference type to be assigned to NullConstant. All reference type instructions therefore have RTI, as now enforced by the SsaChecker. Bug: 24252151 Bug: 24252100 Bug: 22538329 Bug: 25786318 Change-Id: I7a3aee1ff66c82d64b4846611c547af17e91d260
* Get source mapping table from stack maps.David Srbecky2015-12-101-2/+2
| | | | | | | Stack maps contain pc to dex mapping. Reuse them instead of maintaining separate map. Change-Id: Iaaec9a6bd2603eace1dfc8f4344087883d88cce3
* ART: Enable all optimizations except LSE under try/catchDavid Brazdil2015-12-081-40/+20
| | | | | | | | | Dynamic BCE now updates try/catch information during basic block manipulation and can be enabled. The last missing optimization is LSE. This patch removes all special-casing from optimizing_compiler.cc and bails inside LSE instead. Change-Id: Ie0c6fde7295880ea55d35571455a617fce2b7580
* Inline monomorphic calls.Nicolas Geoffray2015-12-041-2/+3
| | | | Change-Id: If38171c2dc7d4a4378df5d050afc4fff4499c98f
* Merge "Clean up optimizing compiler stats"Calin Juravle2015-12-021-4/+2
|\
| * Clean up optimizing compiler statsCalin Juravle2015-12-011-4/+2
| | | | | | | | | | | | | | | | - removed unused stats. - add 'OptStat' prefix to the names of the printed stats to make them `grep` friendly. Change-Id: I189e98b5226465c88c4a00247cd0b9b2ddb6d66e
* | Dynamic BCE (based on induction range analysis)Aart Bik2015-12-011-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rationale: A rewritten dynamic BCE that uses induction variable analysis to generate the run-time tests before a loop in order to eliminate bounds-checks from its body. This CL removes now obsoleted induction related code inside the BCE module. Also, the dynamic test generation is placed more strategically, since we missed a few cases where static analysis does better. Most significant performance improvements (filtering noise) is about: Linpack +20% LU > +10% Change-Id: I03d7631857154b6a131b132f26a2dc568af1b3a1
* | Merge "Optimizing/ARM: Implement kDexCachePcRelative dispatch."Vladimir Marko2015-12-011-0/+15
|\ \
| * | Optimizing/ARM: Implement kDexCachePcRelative dispatch.Vladimir Marko2015-12-011-0/+15
| | | | | | | | | | | | Change-Id: I0fe2da50a30a3f62bec8ea01688dd1fec84b1831
* | | ARM64 read barrier support for concurrent GC in Optimizing.Roland Levillain2015-11-241-2/+3
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This first implementation uses slow paths to instrument heap reference loads and GC root loads for the concurrent copying collector, respectively calling the artReadBarrierSlow and artReadBarrierForRootSlow runtime entry points. Notes: - This implementation does not instrument HInvokeVirtual nor HInvokeInterface instructions (for class reference loads), as the corresponding read barriers are not stricly required with the current concurrent copying collector. - Intrinsics which may eventually call (on slow path) are disabled when read barriers are enabled, as the current slow path infrastructure does not support this case. - When read barriers are enabled, the code generated for a HArraySet instruction always go into the array set slow path for object arrays (delegating the operation to the runtime), as we are lacking a mechanism to keep a temporary register live accross a runtime call (needed for the instrumentation of type checking code, which requires two successive read barriers). Bug: 12687968 Change-Id: Icfb74f67bf23ae80e7723ee6a0c9ff34ba325d48
* | Optimizing: Avoid a PrettyMethod() call per compiled method.Vladimir Marko2015-11-231-12/+19
| | | | | | | | | | | | | | PrettyMethod() is expensive so avoid it unless it's actually needed. Change-Id: I06ab29cc18e426b7dfb8c53b163757c88b53c27f
* | Revert "Add stats support for existing optimizations"Nicolas Geoffray2015-11-231-4/+4
| | | | | | | | | | | | | | | | Breaks the build. Please ensure your changes build. This reverts commit 06241b1b07fb031b7d2cf55f4b78d3444d07cc2d. Change-Id: I68b18f99a9882719bf6654d3313531a7965b8483
* | Add stats support for existing optimizationsJean-Philippe Halimi2015-11-221-4/+4
| | | | | | | | | | | | | | | | This patch adds support for the --dump-stats facility with existing optimizations. Change-Id: I68751b119a030952a11057cb651a3c63e87e73ea Signed-off-by: Jean-Philippe Halimi <jean-philippe.halimi@intel.com>
* | Revert "Dynamic BCE (based on induction range analysis)"Aart Bik2015-11-211-3/+1
| | | | | | | | | | | | | | | | This reverts commit 0b5849be045c5683d4a6b6b6c306abadba5f0fcc. Change-Id: Id33f5da42bbdfb1aff7e2281417c8a7aa492df05 Rationale: so close :-( but bullhead-userdebug (linux) build in git_mnc-dr-dev-plus-aosp reported a breakage with a type inconsistency (long vs int in probably the codegen of dynamic bce); no time to investigate and fix this fully before my trip, so rolling back for now
* | Dynamic BCE (based on induction range analysis)Aart Bik2015-11-201-1/+3
|/ | | | | | | | | | | | | | | Rationale: A rewritten dynamic BCE that uses induction variable analysis to generate the run-time tests before a loop in order to eliminate bounds-checks from its body. This CL removes now obsoleted induction related code inside the BCE module. Also, the dynamic test generation is placed more strategically, since we missed a few cases where static analysis does better. Most significant performance improvements (after filtering noise) is about: Linpack +20% LU > +10% Change-Id: I4e7b8bab0288beff6f98a14856e3536103d32742
* ARM read barrier support for concurrent GC in Optimizing.Roland Levillain2015-11-171-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | This first implementation uses slow paths to instrument heap reference loads and GC root loads for the concurrent copying collector, respectively calling the artReadBarrierSlow and artReadBarrierForRootSlow runtime entry points. Notes: - This implementation does not instrument HInvokeVirtual nor HInvokeInterface instructions (for class reference loads), as the corresponding read barriers are not stricly required with the current concurrent copying collector. - Intrinsics which may eventually call (on slow path) are disabled when read barriers are enabled, as the current slow path infrastructure does not support this case. - When read barriers are enabled, the code generated for a HArraySet instruction always go into the array set slow path for object arrays (delegating the operation to the runtime), as we are lacking a mechanism to keep a temporary register live accross a runtime call (needed for the instrumentation of type checking code, which requires two successive read barriers). Bug: 12687968 Change-Id: I92e8db414d029f952c07f3d3a98069e46dfdbc2a
* x86/x86-64 read barrier support for concurrent GC in Optimizing.Roland Levillain2015-11-151-3/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | This first implementation uses slow paths to instrument heap reference loads and GC root loads for the concurrent copying collector, respectively calling the artReadBarrierSlow and artReadBarrierForRootSlow (new) runtime entry points. Notes: - This implementation does not instrument HInvokeVirtual nor HInvokeInterface instructions (for class reference loads), as the corresponding read barriers are not stricly required with the current concurrent copying collector. - Intrinsics which may eventually call (on slow path) are disabled when read barriers are enabled, as the current slow path infrastructure does not support this case. - When read barriers are enabled, the code generated for a HArraySet instruction always go into the array set slow path for object arrays (delegating the operation to the runtime), as we are lacking a mechanism to keep a temporary register live accross a runtime call (needed for the instrumentation of type checking code, which requires two successive read barriers). Bug: 12687968 Change-Id: I14cd6107233c326389120336f93955b28ffbb329
* Merge "Optimizing/X86: PC-relative dex cache array addressing."Vladimir Marko2015-11-121-4/+3
|\
| * Optimizing/X86: PC-relative dex cache array addressing.Vladimir Marko2015-11-121-4/+3
| | | | | | | | | | | | | | | | Add PC-relative dex cache array addressing for X86 and use it for better invoke-static/-direct dispatch. Also delay the initialization to the PC-relative base until needed. Change-Id: Ib8634d5edce4920cd70172fd13211809cf6948d1
* | Revert "Revert "Run type propagation after inliner only when needed.""Calin Juravle2015-11-111-13/+2
| | | | | | | | | | | | This reverts commit 271743601650308c7ac5c7a3ec35025d8130a298. Change-Id: I173e27a0a4d7d54f90ca459eb48d280d1d40ab70
* | Revert "Revert "ART: Update DCE to work with try/catch""David Brazdil2015-11-101-0/+1
|/ | | | | | | | | | | The previous CL failed because it did not update inputs of catch phis. Since phi input indices cannot be easily mapped back to throwing instructions, this new implementation at least removes catch phi uses of values defined in the removed blocks to preserve graph consistency. This reverts commit fb552d7061746f7a90fdd5002696e255e2e15c35. Change-Id: I63d95915d1ef50e71d3bcf0cd10aaded554035b4
* Code cleanup to avoid CompilerDriver abstractions in JIT.Nicolas Geoffray2015-11-051-152/+194
| | | | | | Avoids allocating a CompiledMethod. Change-Id: I35b4aa0d7c74daba68e827a01e71c300fce3b3bf
* ART: Enable inlining under try/catchDavid Brazdil2015-10-301-2/+2
| | | | | | | | | This patch updates the inliner to set try/catch information when inlining into a method with try/catch. It does not yet allow inlining of methods with try/catch because that will require generating catch stack maps with inline info. Change-Id: I7d57e1454e7da537d75c5c7eda60b22f3a30fa60
* Revert "ART: Enable more passes under try/catch"David Brazdil2015-10-291-22/+34
| | | | | | | | | BCE does not set TryCatchInformation when creating new blocks. Will be fixed with DynamicBCE CL. This reverts commit 39fabd6bb6fcf7a712b370d3b6fd0ada83e2e5d8. Change-Id: I76ae707ac132bb1a4a9f64f4916ffcd786ef730c
* ART: Enable more passes under try/catchDavid Brazdil2015-10-291-34/+22
| | | | | | | LICM, BCE, LSE are all safe under try/catch. Inliner and DCE need updating and will be enabled in follow-up CLs. Change-Id: I86db5f811257d5e765fea91666a2a2af0fb24ec3
* Merge "Reduce memory used by CompiledMethods."Vladimir Marko2015-10-271-2/+2
|\
| * Reduce memory used by CompiledMethods.Vladimir Marko2015-10-271-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use LengthPrefixedArray<>s instead of SwapVector<>s to store CompiledMethod data and get rid of the unnecessary members of CompiledMethod to reduce dex2oat memory usage. Refactor the deduplication from CompilerDriver to a new class. Use HashSet<> instead of std::set<> for the DedupeSet<> to further decrease the memory usage and improve performance. This reduces the dex2oat memory usage when compiling boot image on Nexus 5 (with Optimizing, -j1) by ~6.75MiB (5%). This also reduces the compile time by ~2.2% (~1.6% dex2oat time; with Optimizing, without -j). Change-Id: I974f1f5e58350de2bf487a2bca3907fa05fb80ea
* | Merge "Optimizing: Determine invoke-static/-direct dispatch early."Vladimir Marko2015-10-271-4/+14
|\ \ | |/ |/|
| * Optimizing: Determine invoke-static/-direct dispatch early.Vladimir Marko2015-10-231-4/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Determine the dispatch type of invoke-static/-direct in a special pass right after the type inference. This allows the inliner to pass the "needs dex cache" check and inline more. It also allows the code generator to avoid requesting a register location for the ArtMethod* for kDexCachePcRelative and direct methods. The supported dispatch check handles also situations that the CompilerDriver currently doesn't allow. The cleanup of the CompilerDriver and required changes to Quick will come in a separate change. Change-Id: I3f8e903a119949e95871d8ab0a995f4731a13a07
* | Merge "Revert "Run type propagation after inliner only when needed.""Calin Juravle2015-10-261-2/+12
|\ \
| * | Revert "Run type propagation after inliner only when needed."Calin Juravle2015-10-261-2/+12
| | | | | | | | | | | | | | | | | | This reverts commit 4e5dd521063beae1706410419f19c7e224db50fe. Change-Id: I0de261d14dd3f71abe05f9bc71744820cf23b937
* | | Merge "Run type propagation after inliner only when needed."Calin Juravle2015-10-261-12/+2
|\| |
| * | Run type propagation after inliner only when needed.Calin Juravle2015-10-231-12/+2
| | | | | | | | | | | | | | | | | | | | | | | | Currently we run a type propagation pass unconditionally after the inliner. This change looks at the returned value (if any) and runs a minimal type propagation only if its type has changed. Change-Id: I0dd72bd481219081e8a978d2632426afc980d73a
* | | Revert "Revert "load store elimination.""Mingyao Yang2015-10-221-0/+3
| |/ |/| | | | | | | | | This reverts commit 8030c4100d2586fac39ed4007c61ee91d4ea4f25. Change-Id: I79558d85484be5f5d04e4a44bea7201fece440f0
* | MIPS: Initial version of optimizing compiler for MIPS32Goran Jakovljevic2015-10-221-0/+1
|/ | | | Change-Id: I370388e8d5de52c7001552b513877ef5833aa621
* Merge "Use DlMallocSpace for the JIT code cache."Nicolas Geoffray2015-10-211-10/+18
|\
| * Use DlMallocSpace for the JIT code cache.Nicolas Geoffray2015-10-211-10/+18
| | | | | | | | | | | | | | - Also tidy up some code in the JIT compiler. - And mprotect code space to be writable only when allocating. Change-Id: I46ea5c029aec489f2af63452de31db3736aebc20
* | Use ATTRIBUTE_UNUSED more.Roland Levillain2015-10-151-1/+0
| | | | | | | | | | | | Use it in lieu of UNUSED(), which had some incorrect uses. Change-Id: If247dce58b72056f6eea84968e7196f0b5bef4da
* | Revert "load store elimination."Nicolas Geoffray2015-10-151-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | Breaks libcore tests: libcore.java.lang.ref.FinalizeTest#testWatchdogDoesNotFailForObjectsThatAreNearTheDeadline libcore.java.util.ResourceLeakageDetectorTest#testDetectsUnclosedCloseGuard org.apache.harmony.tests.java.lang.ref.ReferenceTest#test_finalizeReferenceInteraction This reverts commit 589dac7f0ce078d19aad7e35bb0195c47ddf01d2. Change-Id: I55115765c10762d5bc152d3425e4622560d8b9f4
* | load store elimination.Mingyao Yang2015-10-151-0/+3
|/ | | | | | | | | This adds a pass to eliminate some unnecessary heap loads/stores. It first collects heap locations and then tracks values stored to those heap locations. Alias analysis is done based on offset, type, singleton, pre-existence, etc. Change-Id: I11a9d8ef20d1b2f245607eb25118e9aff9be472a
* Optimizing: Move GraphChecker memory allocations to arena.Vladimir Marko2015-10-121-2/+2
| | | | | Bug: 18120045 Change-Id: I3934158e6ea4868d9baa1dfcc53b603ca6c521e2
* Don't check for optimizing test marker on unsupported ISAs.Calin Juravle2015-10-091-2/+6
| | | | Change-Id: I39b31e770f4a9f1f5806cc4b28009e2f1908ad43
* Enforce optimizing test marker for verification errors.Calin Juravle2015-10-071-6/+8
| | | | Change-Id: Ie7babf162729fa02d285572ee043fa9e588d73cc