summaryrefslogtreecommitdiff
path: root/compiler/optimizing/optimizing_compiler.cc
AgeCommit message (Collapse)Author
2015-06-17Fix a bug in optimizing when the null constant has been DCE.Nicolas Geoffray
If it has been DCE, we should create a new one, instead of using the old one. Also move the first DCE to a place where it could actually be useful. bug:21870788 Change-Id: I28fc52ae481ef92cba45fc1b5abcf07c995f524c
2015-06-12Optimizing: Move optimization objects to Arena.Vladimir Marko
This should reduce the stack size needed by the OptimizingCompiler::CompileOptimized() which was very close to our limits for clang builds, causing repeated build breakages on otherwise healthy changes: art/compiler/optimizing/optimizing_compiler.cc:395:37: error: stack frame size of 1760 bytes in function 'art::OptimizingCompiler::CompileOptimized' [-Werror,-Wframe-larger-than=] Change-Id: I2f4ab0235f4eac61823a4a320bb4fe78942a23c2
2015-06-10Revert "Revert "Support for inlining virtual and interface calls.""Nicolas Geoffray
It now works thanks to: - https://android-review.googlesource.com/#/c/154016/ where the invoke type is changed. - The new FindMethodIndexIn method in this change, that locates the right method index relative to the caller's dex file. This reverts commit 6e4758615308bb525b6350c30468e33a2e1f2274. Change-Id: Iddba11664a9241e210fec211cd2aed9f4b90d118
2015-06-08Revert "Support for inlining virtual and interface calls."Nicolas Geoffray
Fails for some apps. bug: 21674542 This reverts commit 1d5006c34d75758752bf3499892e3d5beb11d5dc. Change-Id: Ia74b5e54d59f8ffe9992591324a12f71efb67af4
2015-06-04Support for inlining virtual and interface calls.Nicolas Geoffray
Also had to change the pass order to get reference type propagation before the inliner. Change-Id: I4bf3bbb2d17c7d9cab632cfdd96adad8368bdfea
2015-05-29Move mirror::ArtMethod to nativeMathieu Chartier
Optimizing + quick tests are passing, devices boot. TODO: Test and fix bugs in mips64. Saves 16 bytes per most ArtMethod, 7.5MB reduction in system PSS. Some of the savings are from removal of virtual methods and direct methods object arrays. Bug: 19264997 Change-Id: I622469a0cfa0e7082a2119f3d6a9491eb61e3f3d
2015-05-28Add --generate-debug-info flag and remove the other two flags.David Srbecky
Replace the flags --include-debug-symbols and --include-cfi with single flag called --generate-debug-info (with alias -g). The name "symbol" was not ideal, since depending on context it may be interpreted as "ELF symbols", or "debugging information". This CL also means that we have only the options to include either all debugging information or none. This should be fine, since we can use standard tools to strip anything we do not want. Change-Id: I721fded56d755d7eed0ef36aa84e841a1f5747f8
2015-05-22Do not use dex_compilation_unit after inlining.Nicolas Geoffray
It's incompatible with inlining, as inlined invokes/load class/new can be from another dex file. Change-Id: I8897b6a012942bc8e136f2bea70252d3fb3a7fa5
2015-05-21Also encode the InvokeType in an InlineInfo.Nicolas Geoffray
This will be needed to recover the call stack. Change-Id: I2fe10785eb1167939c8cce1862b2d7f4066e16ec
2015-05-19Eliminate redundant constructor barriers when inlining.Calin Juravle
Bug: 20410297 Change-Id: I2097743d00eb795d050d390b1918e38c7f41d506
2015-05-12ART: Rediscover loops after deleting blocks in DCEDavid Brazdil
The way DCE currently updates loop information does not cover all cases. This patch removes the logic, resets loop information of live blocks to pre-SSA state and reanalyzes the affected loops. Change-Id: I0b996a70235b95a8db0de9a23a03f71db57a21b8
2015-05-11Add a parent environment to HEnvironment.Nicolas Geoffray
This code has no functionality change. It adds a placeholder for chaining inlined frames. Change-Id: I5ec57335af76ee406052345b947aad98a6a4423a
2015-04-24Merge "Minor improvements to 458-checker-instruction-simplification."Roland Levillain
2015-04-23ART: Run BooleanSimplifier after inliningDavid Brazdil
Inlined methods are currently not simplified. Change-Id: I075130c9df55e2f55032a2c81b08d42cb2cc01f6
2015-04-22[optimizing] Name the last DCE pass.Calin Juravle
This will allow Checker to differentiate between them. Change-Id: I972d452a64f1c19d370567b9ef3d620f9b835a9a
2015-04-22Run DCE again after all the other optimizations have run.Calin Juravle
On docs this doubles the amount of instructions removed.
2015-04-21Revert "Run DCE again after all the other optimizations have run."Nicolas Geoffray
Reverting because of libcore failures. This reverts commit 7a9c885684c965fe84f91d8ad74f54f869e2a448. Change-Id: Iafe59b02fe7617243d81533d66e609a3528e7a58
2015-04-21Run DCE again after all the other optimizations have run.Calin Juravle
On docs this doubles the amount of instructions removed. Change-Id: I1712a92c0c0b3b32b111d194b64d8ea81d652822
2015-04-21Use --dump-stats to dump optimizing compiler stats.Calin Juravle
VLOG(compiler) produces too much output and it takes a long time if you only need to see how an analysis performs. Change-Id: Ic17c2b2b5fec431d356cecd37289fb96985d4d7f
2015-04-20Minor improvements to 458-checker-instruction-simplification.Alexandre Rames
This follows earlier comments from Roland: https://android-review.googlesource.com/#/c/140446 /2/test/458-checker-instruction-simplification/src/Main.java@337 /2/test/458-checker-instruction-simplification/src/Main.java@465 Change-Id: I255ab74b8885dd8e86bb2c11bba4075fa0eaa183
2015-04-16Merge "Fallback to quick in case of soft verification errors"Calin Juravle
2015-04-16Fallback to quick in case of soft verification errorsCalin Juravle
Add a regression test: using uninitialized values triggers a soft verification error and optimizing should not crash. Thanks to Stephen Kyle (stephenckyle@googlemail.com) for the bug report. Bug: 19988704 Change-Id: I67174538eed853baff735694b3ae8eb34afe2a39
2015-04-15Move the linear order to the HGraph.Nicolas Geoffray
Bug found by Zheng Xu: SsaLivenessAnalysis being a stack allocated object, we should not refer to it in later phases of the compiler. Specifically, the code generator was using the linear order, which was stored in the liveness analysis object. Change-Id: I574641f522b7b86fc43f3914166108efc72edb3b
2015-04-13Add --include-cfi compiler option.David Srbecky
Decouple generation of CFI from the rest of debug symbols. This makes it possible to generate oat with CFI but without the rest of debug symbols. This is in line with intention of the .eh_frame section. The section does not have the .debug_ prefix because it is considered somewhat different to the rest of debug symbols. Change-Id: I32816ecd4f30ac4e0dc69d69a4993e349c737f96
2015-04-13Merge "Revert "Fallback to quick in case of soft verification errors""Calin Juravle
2015-04-13Revert "Fallback to quick in case of soft verification errors"Calin Juravle
This reverts commit c751d37e692d89b360f3c09421401f581b5c6d06. Change-Id: I2183df8e856410989bc019f6a1f58af37d5d7eab
2015-04-13Merge "Fallback to quick in case of soft verification errors"Calin Juravle
2015-04-10Merge "ART: Refactor CompileOptimized"Andreas Gampe
2015-04-10ART: Refactor CompileOptimizedAndreas Gampe
Factor out register allocation. Both Clang and GCC inline the function, but it changes how Clang stack-allocates enough so that the resulting frame size is below our limit. Bug: 20139216 Change-Id: I2cf393aed70f2ce0556252b61ae639aacab6f3a7
2015-04-10Fallback to quick in case of soft verification errorsCalin Juravle
Add a regression test: using uninitialized values triggers a soft verification error and optimizing should not crash. Thanks to Stephen Kyle (stephenckyle@googlemail.com) for the bug report. Bug: 19988704 Change-Id: I2493f737efd3fad72f6b41fb60eff1d3731613fb
2015-04-10ART: Remove WriteElf from CompilerAndreas Gampe
As Portable is gone, we only have one elf_writer left. It also allows to put the decision for 32b vs 64b ELF into a central point. Change-Id: Iae67d06df85268b3f0ee5725abc65edd23eb2499
2015-04-09Fix build - the stack frame is too large.David Srbecky
Change-Id: Icabad2e3ccbaa4783df6c18c60a206357398edc5
2015-04-09Implement CFI for Optimizing.David Srbecky
CFI is necessary for stack unwinding in gdb, lldb, and libunwind. Change-Id: I1a3480e3a4a99f48bf7e6e63c4e83a80cfee40a2
2015-04-08Merge "ART: Fix 64-bit ELF file support"Andreas Gampe
2015-04-07ART: Fix 64-bit ELF file supportAndreas Gampe
The API wasn't cross-compile-safe, 32-bit patchoat would fail for negative delta applied to a 64-bit ELF file. Add 64-bit ELF file output to the compilers, behind a flag, currently off by default (preserving current behavior). Bug: 20095017 Change-Id: I2cde7b4c7cc83413c76692d7b745868d644a604c
2015-04-07ART: Print C1vis header only if visualizer enabledDavid Brazdil
Setting kStringFilter currently suppresses graph dumps of non-matching methods but their headers are still printed. This fixes the issue. Change-Id: Ib33fb20fcca2bf409534a824e7f76f1feb85724d
2015-03-31Merge "Fixed layout for dex caches in boot image."Vladimir Marko
2015-03-31Fixed layout for dex caches in boot image.Vladimir Marko
Define a fixed layout for dex cache arrays (type, method, string and field arrays) for dex caches in the boot image. This gives those arrays fixed offsets from the boot image code and allows PC-relative addressing of their elements. Use the PC-relative load on arm64 for relevant instructions, i.e. invoke-static, invoke-direct, const-string, const-class, check-cast and instance-of. This reduces the arm64 boot.oat on Nexus 9 by 1.1MiB. This CL provides the infrastructure and shows on the arm64 the gains that we can achieve by having fixed dex cache arrays' layout. To fully use this for the boot images, we need to implement the PC-relative addressing for other architectures. To achieve similar gains for apps, we need to move the dex cache arrays to a .bss section of the oat file. These changes will be implemented in subsequent CLs. (Also remove some compiler_driver.h dependencies to reduce incremental build times.) Change-Id: Ib1859fa4452d01d983fd92ae22b611f45a85d69b
2015-03-30[optimizing] Only print full stats in VLOG(compiler)Nicolas Geoffray
Also add a kCompiledQuick stat. bug:19956318 Change-Id: I0c6c0ac256362824eb9f1418216ab7e2c289a17b
2015-03-25Revert "Revert "Inline across dex files.""Nicolas Geoffray
This reverts commit 6a816cf624ba56bf2872916d7b65b18fd9a411ef. Change-Id: I36cb524108786dd7996f2aea0443675be1f1b859
2015-03-24Merge "Share the runtime arena for faster compile times."Nicolas Geoffray
2015-03-24Share the runtime arena for faster compile times.Nicolas Geoffray
Using a shared arena has the downside of getting more contentions when requesting memory, but saves on compilation times because we don't free the memory it allocated util the end of dex2oat. Change-Id: I353ced1db34539850ec639b6b228451b455a48ec
2015-03-24ART: Boolean simplifierDavid Brazdil
The optimization recognizes the negation pattern generated by 'javac' and replaces it with a single condition. To this end, boolean values are now consistently assumed to be represented by an integer. This is a first optimization which deletes blocks from the HGraph and does so by replacing the corresponding entries with null. Hence, existing code can continue indexing the list of blocks with the block ID, but must check for null when iterating over the list. Change-Id: I7779da69cfa925c6521938ad0bcc11bc52335583
2015-03-23Implement a space filter for optimizing.Nicolas Geoffray
Heuristic-based. Currently only for enabling fugu user build. Change-Id: I76e652bd3f00ed84a2a8ad69c7c2c0e24d74cd68
2015-03-17Fall back to Quick when Optimizing cannot compile.Nicolas Geoffray
Currently applies when seeing unresolved types/methods/fields, and methods with try/catch. Change-Id: I93b12d440b39f0b9faf98f08f2bfddedfeff7182
2015-03-16[optimizing] Use baseline when debuggable is set.Nicolas Geoffray
SSA form conflicts with JDWP's SetValue functionality. Because we do not deopt all the call stack, we may call SetValue on a compiled frame, which doesn't work with optimizing. Simplest solution for now is to just use baseline. Change-Id: I91738b363eec8fef145486bd96681aea73a1baa8
2015-03-11Revert "Revert "[optimizing] Enable x86 long support.""Nicolas Geoffray
This reverts commit 154552e666347d41d95d7619c6ee56249ff4feca. Change-Id: Idc726551c249a888b7ff5fde8508ae50e81b2e13
2015-03-10Make the SSA builder honor the debuggable flag.Nicolas Geoffray
This requires to properly type phis that are only used by environments, and discard phis with incomptable types. The code generators do not handle these conflicting types. In the process, ensure a phi has a type that does not depend on the order of the inputs (for example (char, short) -> short), and set int for int-like types. We can refine this later. Change-Id: I60ab601d6d00b1cbf18623ee4ff1795aa28f84a1
2015-03-06Revert "[optimizing] Enable x86 long support."Nicolas Geoffray
Few libcore failures. This reverts commit b4ba354cf8d22b261205494875cc014f18587b50. Change-Id: I4a28d853e730dff9b69aec9555505803cf2fcd63
2015-03-06[optimizing] Enable x86 long support.Nicolas Geoffray
Change-Id: I9006972a65a1f191c45691104a960366747f9d16