summaryrefslogtreecommitdiff
path: root/compiler/optimizing/optimizing_compiler.cc
AgeCommit message (Collapse)Author
2015-12-31ART: Refactor SsaBuilder for more precise typing infoDavid Brazdil
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
2015-12-23Dex2oat support for multiple oat file and image file outputs.Jeff Hao
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
2015-12-17Merge "Revert "Tweak inlining heuristics.""Nicolas Geoffray
2015-12-17Revert "Tweak inlining heuristics."Nicolas Geoffray
This reverts commit fcb7613d3aaa9a6802800b6e957aaad51cedf6dc. Change-Id: Idc0df6a2f68e8b5aa740bb1259f19c2953811510
2015-12-17Merge "Tweak inlining heuristics."Nicolas Geoffray
2015-12-17Tweak inlining heuristics.Nicolas Geoffray
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
2015-12-15Revert "ART: Refactor SsaBuilder for more precise typing info"Alex Light
This reverts commit d9510dfc32349eeb4f2145c801f7ba1d5bccfb12. Bug: 26208284 Bug: 24252151 Bug: 24252100 Bug: 22538329 Bug: 25786318 Change-Id: I5f491becdf076ff51d437d490405ec4e1586c010
2015-12-14ART: Refactor SsaBuilder for more precise typing infoDavid Brazdil
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
2015-12-10Get source mapping table from stack maps.David Srbecky
Stack maps contain pc to dex mapping. Reuse them instead of maintaining separate map. Change-Id: Iaaec9a6bd2603eace1dfc8f4344087883d88cce3
2015-12-08ART: Enable all optimizations except LSE under try/catchDavid Brazdil
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
2015-12-04Inline monomorphic calls.Nicolas Geoffray
Change-Id: If38171c2dc7d4a4378df5d050afc4fff4499c98f
2015-12-02Merge "Clean up optimizing compiler stats"Calin Juravle
2015-12-01Dynamic BCE (based on induction range analysis)Aart Bik
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
2015-12-01Clean up optimizing compiler statsCalin Juravle
- removed unused stats. - add 'OptStat' prefix to the names of the printed stats to make them `grep` friendly. Change-Id: I189e98b5226465c88c4a00247cd0b9b2ddb6d66e
2015-12-01Merge "Optimizing/ARM: Implement kDexCachePcRelative dispatch."Vladimir Marko
2015-12-01Optimizing/ARM: Implement kDexCachePcRelative dispatch.Vladimir Marko
Change-Id: I0fe2da50a30a3f62bec8ea01688dd1fec84b1831
2015-11-24ARM64 read barrier support for concurrent GC in Optimizing.Roland Levillain
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
2015-11-23Optimizing: Avoid a PrettyMethod() call per compiled method.Vladimir Marko
PrettyMethod() is expensive so avoid it unless it's actually needed. Change-Id: I06ab29cc18e426b7dfb8c53b163757c88b53c27f
2015-11-23Revert "Add stats support for existing optimizations"Nicolas Geoffray
Breaks the build. Please ensure your changes build. This reverts commit 06241b1b07fb031b7d2cf55f4b78d3444d07cc2d. Change-Id: I68b18f99a9882719bf6654d3313531a7965b8483
2015-11-22Add stats support for existing optimizationsJean-Philippe Halimi
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>
2015-11-21Revert "Dynamic BCE (based on induction range analysis)"Aart Bik
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
2015-11-20Dynamic BCE (based on induction range analysis)Aart Bik
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
2015-11-17ARM read barrier support for concurrent GC in Optimizing.Roland Levillain
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
2015-11-15x86/x86-64 read barrier support for concurrent GC in Optimizing.Roland Levillain
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
2015-11-12Merge "Optimizing/X86: PC-relative dex cache array addressing."Vladimir Marko
2015-11-12Optimizing/X86: PC-relative dex cache array addressing.Vladimir Marko
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
2015-11-11Revert "Revert "Run type propagation after inliner only when needed.""Calin Juravle
This reverts commit 271743601650308c7ac5c7a3ec35025d8130a298. Change-Id: I173e27a0a4d7d54f90ca459eb48d280d1d40ab70
2015-11-10Revert "Revert "ART: Update DCE to work with try/catch""David Brazdil
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
2015-11-05Code cleanup to avoid CompilerDriver abstractions in JIT.Nicolas Geoffray
Avoids allocating a CompiledMethod. Change-Id: I35b4aa0d7c74daba68e827a01e71c300fce3b3bf
2015-10-30ART: Enable inlining under try/catchDavid Brazdil
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
2015-10-29Revert "ART: Enable more passes under try/catch"David Brazdil
BCE does not set TryCatchInformation when creating new blocks. Will be fixed with DynamicBCE CL. This reverts commit 39fabd6bb6fcf7a712b370d3b6fd0ada83e2e5d8. Change-Id: I76ae707ac132bb1a4a9f64f4916ffcd786ef730c
2015-10-29ART: Enable more passes under try/catchDavid Brazdil
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
2015-10-27Merge "Reduce memory used by CompiledMethods."Vladimir Marko
2015-10-27Reduce memory used by CompiledMethods.Vladimir Marko
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
2015-10-27Merge "Optimizing: Determine invoke-static/-direct dispatch early."Vladimir Marko
2015-10-26Merge "Revert "Run type propagation after inliner only when needed.""Calin Juravle
2015-10-26Revert "Run type propagation after inliner only when needed."Calin Juravle
This reverts commit 4e5dd521063beae1706410419f19c7e224db50fe. Change-Id: I0de261d14dd3f71abe05f9bc71744820cf23b937
2015-10-26Merge "Run type propagation after inliner only when needed."Calin Juravle
2015-10-23Run type propagation after inliner only when needed.Calin Juravle
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
2015-10-23Optimizing: Determine invoke-static/-direct dispatch early.Vladimir Marko
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
2015-10-22Revert "Revert "load store elimination.""Mingyao Yang
This reverts commit 8030c4100d2586fac39ed4007c61ee91d4ea4f25. Change-Id: I79558d85484be5f5d04e4a44bea7201fece440f0
2015-10-22MIPS: Initial version of optimizing compiler for MIPS32Goran Jakovljevic
Change-Id: I370388e8d5de52c7001552b513877ef5833aa621
2015-10-21Merge "Use DlMallocSpace for the JIT code cache."Nicolas Geoffray
2015-10-21Use DlMallocSpace for the JIT code cache.Nicolas Geoffray
- Also tidy up some code in the JIT compiler. - And mprotect code space to be writable only when allocating. Change-Id: I46ea5c029aec489f2af63452de31db3736aebc20
2015-10-15Use ATTRIBUTE_UNUSED more.Roland Levillain
Use it in lieu of UNUSED(), which had some incorrect uses. Change-Id: If247dce58b72056f6eea84968e7196f0b5bef4da
2015-10-15Revert "load store elimination."Nicolas Geoffray
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
2015-10-15load store elimination.Mingyao Yang
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
2015-10-12Optimizing: Move GraphChecker memory allocations to arena.Vladimir Marko
Bug: 18120045 Change-Id: I3934158e6ea4868d9baa1dfcc53b603ca6c521e2
2015-10-09Don't check for optimizing test marker on unsupported ISAs.Calin Juravle
Change-Id: I39b31e770f4a9f1f5806cc4b28009e2f1908ad43
2015-10-07Enforce optimizing test marker for verification errors.Calin Juravle
Change-Id: Ie7babf162729fa02d285572ee043fa9e588d73cc