summaryrefslogtreecommitdiff
path: root/compiler/optimizing/optimizing_compiler.cc
AgeCommit message (Collapse)Author
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
2015-02-24ART: Add -WunusedAndreas Gampe
Until the global CFLAGS are fixed, add Wunused. Fix declarations in the optimizing compiler. Change-Id: Ic4553f08e809dc54f3d82af57ac592622c98e000
2015-02-20Merge "Reference type propagation"Calin Juravle
2015-02-19Move arenas into runtimeMathieu Chartier
Moved arena pool into the runtime. Motivation: Allow GC to use arena allocators, recycle arena pool for linear alloc. Bug: 19264997 Change-Id: I8ddbb6d55ee923a980b28fb656c758c5d7697c2f
2015-02-19Reference type propagationCalin Juravle
- propagate reference types between instructions - remove checked casts when possible - add StackHandleScopeCollection to manage an arbitrary number of stack handles (see comments) Change-Id: I31200067c5e7375a5ea8e2f873c4374ebdb5ee60
2015-02-19Have the opt. compiler set the size of "empty" frames to zero.Roland Levillain
This is to mimic Quick's behavior and honor stack frame alignment constraints after changes introduced by Change-Id I0fdb31e8c631e99091b818874a558c9aa04b1628. This issue use to make oatdump crash on oat files produced by the optimized compiler (e.g. out/host/linux-x86/framework/x86_64/core-optimizing.oat). Change-Id: I8ba52601edb0a0993eaf8923eba55aafdce5043e
2015-02-05ART: Fix crash when timing method failing to buildDavid Brazdil
PassInfoPrinter previously required that AfterPass is always called before the timing results are printed, which was not the case when a method compilation failed either in Builder or SsaBuilder. Change-Id: I3686bba6869402a62eec884f59fd872d5674e5a5
2015-02-04Create HGraph outside Builder, print timingsDavid Brazdil
This patch refactors the way HGraph objects are created, moving the instantiation out of the Builder class and creating the CodeGenerator earlier. The patch uses this to build a single interface for printing timings info and dumping the CFG. Change-Id: I2eb63eabf28e2d0f5cdc7affaa690c3a4b1bdd21
2015-01-30Implement LICM in optimizing compiler.Nicolas Geoffray
Change-Id: I9c8afb0a58ef45e568576015473cbfd5f011c242
2015-01-29optimizing: NullCheck eliminationCalin Juravle
How it works: - run a type analysis to propagate null information on instructions - during the last instruction simplifier remove null checks for which the input is known to be not null The current type analysis is actually a nullability analysis but it will be reused in follow up CLs to propagate type information: so it keeps the more convenient name. Change-Id: I54bb1d32ab24604b4d677d1ecdaf8d60a5ff5ce9