summaryrefslogtreecommitdiff
path: root/compiler/optimizing/optimizing_compiler.cc
Commit message (Collapse)AuthorAgeFilesLines
...
* Revert "Revert "Refactor HGraphBuilder and SsaBuilder to remove HLocals""David Brazdil2016-04-071-2/+3
| | | | | | | | | | | | | | | | | | | | This patch merges the instruction-building phases from HGraphBuilder and SsaBuilder into a single HInstructionBuilder class. As a result, it is not necessary to generate HLocal, HLoadLocal and HStoreLocal instructions any more, as the builder produces SSA form directly. Saves 5-15% of arena-allocated memory (see bug for more data): GMS 20.46MB => 19.26MB (-5.86%) Maps 24.12MB => 21.47MB (-10.98%) YouTube 28.60MB => 26.01MB (-9.05%) This CL fixed an issue with parsing quickened instructions. Bug: 27894376 Bug: 27998571 Bug: 27995065 Change-Id: I20dbe1bf2d0fe296377478db98cb86cba695e694
* Merge "Clean up OatQuickMethodHeader after Quick removal."Vladimir Marko2016-04-051-4/+0
|\
| * Clean up OatQuickMethodHeader after Quick removal.Vladimir Marko2016-04-041-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | This reduces the size of the pre-header by 8 bytes, reducing oat file size and mmapped .text section size. The memory needed to store a CompiledMethod by dex2oat is also reduced, for 32-bit dex2oat by 8B and for 64-bit dex2oat by 16B. The aosp_flounder-userdebug 32-bit and 64-bit boot.oat are each about 1.1MiB smaller. Disable the broken StubTest.IMT, b/27991555 . Change-Id: I05fe45c28c8ffb7a0fa8b1117b969786748b1039
* | Revert "Refactor HGraphBuilder and SsaBuilder to remove HLocals"David Brazdil2016-04-041-3/+2
|/ | | | | | | Bug: 27995065 This reverts commit e3ff7b293be2a6791fe9d135d660c0cffe4bd73f. Change-Id: I5363c7ce18f47fd422c15eed5423a345a57249d8
* Refactor HGraphBuilder and SsaBuilder to remove HLocalsDavid Brazdil2016-04-041-2/+3
| | | | | | | | | | | | | | | This patch merges the instruction-building phases from HGraphBuilder and SsaBuilder into a single HInstructionBuilder class. As a result, it is not necessary to generate HLocal, HLoadLocal and HStoreLocal instructions any more, as the builder produces SSA form directly. Saves 5-15% of arena-allocated memory (see bug for more data): GMS 20.46MB => 19.26MB (-5.86%) Maps 24.12MB => 21.47MB (-10.98%) YouTube 28.60MB => 26.01MB (-9.05%) Bug: 27894376 Change-Id: Iefe28d40600c169c5d306fd2c77034ae19476d90
* Build dominator tree before generating HInstructionsDavid Brazdil2016-04-041-1/+6
| | | | | | | | | | | | | | | Second CL in the series of merging HGraphBuilder and SsaBuilder. This patch refactors the builders so that dominator tree can be built before any HInstructions are generated. This puts the SsaBuilder removal of HLoadLocals/HStoreLocals straight after HGraphBuilder's HInstruction generation phase. Next CL will therefore be able to merge them. This patch also adds util classes for iterating bytecode and switch tables which allowed to simplify the code. Bug: 27894376 Change-Id: Ic425d298b2e6e7980481ed697230b1a0b7904526
* Merge "Post-Quick cleanup: Remove CompilationUnit."Vladimir Marko2016-03-241-12/+11
|\
| * Post-Quick cleanup: Remove CompilationUnit.Vladimir Marko2016-03-241-12/+11
| | | | | | | | Change-Id: I309411b0fffaaed1e218e2c34394bdf6e2f75b48
* | Revert "Revert "Use compiler filter to determine oat file status.""Andreas Gampe2016-03-231-1/+1
|/ | | | | | | | | | | This reverts commit 845e5064580bd37ad5014f7aa0d078be7265464d. Add an option to change what OatFileManager considers up-to-date. In our tests we're allowed to write to the dalvik-cache, so it cannot be kSpeed. Bug: 27689078 Change-Id: I0c578705a9921114ed1fb00d360cc7448addc93a
* Revert "Use compiler filter to determine oat file status."Nicolas Geoffray2016-03-231-1/+1
| | | | | | | | | | Bots are red. Tentative reverting as this is likely the offender. Bug: 27689078 This reverts commit a62d2f04a6ecf804f8a78e722a6ca8ccb2dfa931. Change-Id: I3ec6947a5a4be878ff81f26f17dc36a209734e2a
* Use compiler filter to determine oat file status.Richard Uhler2016-03-221-1/+1
| | | | | | | | | | | | | | | Record the compiler filter in the oat header. Use that to determine when the oat file is up-to-date with respect to a target compiler filter level. New xxx-profile filter levels are added to specify if a profile should be used instead of testing for the presence of a profile file. This change should allow for different compiler-filters to be set for different package manager use cases. Bug: 27689078 Change-Id: Id6706d0ed91b45f307142692ea4316aa9713b023
* ART: Clean up arena allocation memory tracking.Vladimir Marko2016-03-221-7/+16
| | | | | | | | | Remove unused allocation types, mostly from removed Quick. Move logging one level up to capture memory used by stack maps during AOT compilation. Raise the reporting threshold to 8MiB to limit the output to the worst offenders. Change-Id: I8c7a01bfa90bc8ec5eab66187eb6850a022f3543
* Merge "Clean up NullCheck generation and record stats about it."Calin Juravle2016-03-161-1/+2
|\
| * Clean up NullCheck generation and record stats about it.Calin Juravle2016-03-161-1/+2
| | | | | | | | | | | | | | This removes redundant code from the generators and allows for easier stat recording. Change-Id: Iccd4368f9e9d87a6fecb863dee4e2145c97851c4
* | Add more statistics for memory use of the JIT.Nicolas Geoffray2016-03-161-1/+1
| | | | | | | | | | | | | | | | Collect data for stack maps, profiling info, and compiled code. bug:27520994 Change-Id: Ic87361230c96ce0090027a37d750e948d806c597
* | Collect memory use for the JIT.Nicolas Geoffray2016-03-161-0/+3
|/ | | | | | bug:27520994 Change-Id: I67b0c5b822001bfde8738a988c1ade69f1a26e3f
* Add trampoline symbols to native debug info.David Srbecky2016-03-111-1/+2
| | | | | | | The debugger needs them to unwind through the trampolines and to understand what is happening in the call stack. Change-Id: Ia554058c3796788adcd7336d620a7734eb366905
* Merge "Allow generation of native debug info for multiple methods."David Srbecky2016-03-111-2/+2
|\
| * Allow generation of native debug info for multiple methods.David Srbecky2016-03-101-2/+2
| | | | | | | | | | | | Slight tweak in the API which I will need in the near future. Change-Id: I45954ae16710bc941a9a06a3a17c70798315ca53
* | Merge "Refactor MethodDebugInfo (input of DWARF writer)."David Srbecky2016-03-111-26/+17
|\|
| * Refactor MethodDebugInfo (input of DWARF writer).David Srbecky2016-03-101-26/+17
| | | | | | | | | | | | | | | | | | Do not pass CompiledMethod pointer through since it is only available during AOT compile but not during JIT compile or at runtime. Creating mock CompiledMethod just pass data is proving increasingly tricky, so copy the fields that we need to MethodDebugInfo instead. Change-Id: I820297b41e769fcac488c0ff2d2ea0492bb13ed8
* | Avoid generating dead code on frame enter/exit.Aart Bik2016-03-101-3/+5
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This includes stack operations and, on x86, call/pop to read PC. bug=26997690 Rationale: (1) If method is fully intrinsified, and makes no calls in slow path or uses special input, no need to require current method. (2) Invoke instructions with HasPcRelativeDexCache() generate code that reads the PC (call/pop) on x86. However, if the invoke is an intrinsic that is later replaced with actual code, this PC reading code may be dead. Example X86 (before/after): 0x0000108c: 83EC0C sub esp, 12 0x0000108f: 890424 mov [esp], eax <-- not needed 0x00001092: E800000000 call +0 (0x00001097) 0x00001097: 58 pop eax <-- dead code to read PC 0x00001098: F30FB8C1 popcnt eax, ecx 0x0000109c: F30FB8DA popcnt ebx, edx 0x000010a0: 03D8 add ebx, eax 0x000010a2: 89D8 mov eax, ebx 0x000010a4: 83C40C add esp, 12 <-- not needed 0x000010a7: C3 ret 0x0000103c: F30FB8C1 popcnt eax, ecx 0x00001040: F30FB8DA popcnt ebx, edx 0x00001044: 03D8 add ebx, eax 0x00001046: 89D8 mov eax, ebx 0x00001048: C3 ret Example ARM64 (before/after): 0x0000103c: f81e0fe0 str x0, [sp, #-32]! 0x00001040: f9000ffe str lr, [sp, #24] 0x00001044: dac01020 clz x0, x1 0x00001048: f9400ffe ldr lr, [sp, #24] 0x0000104c: 910083ff add sp, sp, #0x20 (32) 0x00001050: d65f03c0 ret 0x0000103c: dac01020 clz x0, x1 0x00001040: d65f03c0 ret Change-Id: I8377db80c9a901a08fff4624927cf4a6e585da0c
* Mark DWARF lines in non-debuggable methods as "not a statement".David Srbecky2016-03-081-1/+3
| | | | | | | This is a hint to the debugger that breakpoints and stepping might not function as intended (since we have limited information). Change-Id: I23c4a816182cc7548fcd69fbd00112225e7b1710
* Propagate InstructionSetFeatures to ElfBuilder.David Srbecky2016-03-081-1/+4
| | | | | | | This is subset of CL171665 and it separates it into two. It will be needed to generate .MIPS.abiflags ELF section. Change-Id: I5557e7cb98d0fa1dc57c85cf6161e119c6d50a1a
* Add a PassScope for PrepareForRegisterAllocationMingyao Yang2016-03-021-1/+5
| | | | | | This pass does transform the graph so make it part of cfg-dumping. Change-Id: I42e361382c85c97b974faad8bb0fcf2cb0750355
* Give the JIT its own arena pool to avoid lock contentions.Nicolas Geoffray2016-03-011-1/+1
| | | | | | | | | Sharing it with the verifier and the class loader is not ideal, especially at startup time. bug:27398183 bug:23128949 Change-Id: I1b91663a13f6c5b33ad3b4be780d93eb7fe445b4
* Revert "Revert "ARM/ARM64: Extend support of instruction combining.""Artem Udovichenko2016-02-251-0/+4
| | | | | | This reverts commit 6b5afdd144d2bb3bf994240797834b5666b2cf98. Change-Id: Ic27a10f02e21109503edd64e6d73d1bb0c6a8ac6
* Merge "The JIT does not need VerifedMethod nor CompilerCallbacks."Nicolas Geoffray2016-02-191-1/+1
|\
| * The JIT does not need VerifedMethod nor CompilerCallbacks.Nicolas Geoffray2016-02-181-1/+1
| | | | | | | | | | | | bug:27173201 Change-Id: I971659f9ff6a8b780c94a7bed84de90fa9fc3456
* | Add statistics support for some optimizationsJean-Philippe Halimi2016-02-181-3/+3
|/ | | | | | | | | | This patch adds support for the --dump-stats facility with some optimizations and fixes all build issues introduced by the patch: I68751b119a030952a11057cb651a3c63e87e73ea (which got reverted) Change-Id: I5af1f2a8cced0a1a55c2bb4d8c88e6f0a24ec879 Signed-off-by: Jean-Philippe Halimi <jean-philippe.halimi@intel.com>
* ART: Run SsaBuilder from HGraphBuilderDavid Brazdil2016-02-151-72/+61
| | | | | | | | | | | First step towards merging the two passes, which will later result in HGraphBuilder directly producing SSA form. This CL mostly just updates tests broken by not being able to inspect the pre-SSA form. Using HLocals outside the HGraphBuilder is now deprecated. Bug: 27150508 Change-Id: I00fb6050580f409dcc5aa5b5aa3a536d6e8d759e
* Split elf_writer_debug.cc to several files.David Srbecky2016-02-081-3/+3
| | | | | | | Refactoring only. The file has grown significantly over time, and it is time to split it so it can be better managed. Change-Id: Idce0231718add722292f4701df353d5baf31de5f
* Merge "Move code related to debug info generation to its own directory."David Srbecky2016-02-081-7/+6
|\
| * Move code related to debug info generation to its own directory.David Srbecky2016-02-081-7/+6
| | | | | | | | | | | | | | | | | | | | debug/dwarf/ contains helper classes which hide the details of the DWARF file format. It acts as independent DWARF library. debug/ contains ART-specific code which generates ELF debug sections (which includes non-DWARF sections like .symtab). Change-Id: Id351f604e4e64be2ca395a78324ea02e30481497
* | Revert "Revert "Implement on-stack replacement for arm/arm64/x86/x86_64.""Nicolas Geoffray2016-02-051-14/+28
|/ | | | | | This reverts commit bd89a5c556324062b7d841843b039392e84cfaf4. Change-Id: I08d190431520baa7fcec8fbdb444519f25ac8d44
* ART: Implement HSelectDavid Brazdil2016-01-281-4/+4
| | | | | | | | | | | | | | | | | This patch adds a new HIR instruction to Optimizing. HSelect returns one of two inputs based on the outcome of a condition. This is only initial implementation which: - defines the new instruction, - repurposes BooleanSimplifier to emit it, - extends InstructionSimplifier to statically resolve it, - updates existing code and tests accordingly. Code generators currently emit fallback if/then/else code and will be updated in follow-up CLs to use platform-specific conditional moves when possible. Change-Id: Ib61b17146487ebe6b55350c2b589f0b971dcaaee
* Revert "Revert "Add option to generate compressed backtrace info.""David Srbecky2016-01-261-1/+1
| | | | | | This reverts commit 8546cc9aeb05e866e1fb6a9e4130d53ea330baa8. Change-Id: I676fdf9af27fa3b16fa8921778ff8832ab8c437d
* Revert "Add option to generate compressed backtrace info."David Srbecky2016-01-251-1/+1
| | | | | | This reverts commit 5fdcc3c931b70204fd8c491afa66f57f8428490f. Change-Id: I9c1f5aad6933a46af6717e3a90a51f76111f9c8a
* Add option to generate compressed backtrace info.David Srbecky2016-01-221-1/+1
| | | | | | | | | | Add flag --generate-mini-debug-info which generates LZMA compressed .symtab and .debug_frame, which are sufficient to print java backtraces in libunwind. If enabled, it increases the size of boot.oat by about 3.5%. Change-Id: Ic3c2ef7704c05fa328720c6781ca2a9b8e3935a3
* Revert "ARM/ARM64: Extend support of instruction combining."Nicolas Geoffray2016-01-221-5/+1
| | | | | | | | The test fails its checker parts. This reverts commit debeb98aaa8950caf1a19df490f2ac9bf563075b. Change-Id: I49929e15950c7814da6c411ecd2b640d12de80df
* ARM/ARM64: Extend support of instruction combining.Ilmir Usmanov2016-01-211-1/+5
| | | | | | | | | | | Combine multiply instructions in the following way: ARM64: MUL/NEG -> MNEG ARM32 (32-bit integers only): MUL/ADD -> MLA MUL/SUB -> MLS Change-Id: If20f2d8fb060145ab6fbceeb5a8f1a3d02e0ecdb
* Merge "ART: Remove Baseline compiler"David Brazdil2016-01-181-108/+41
|\
| * ART: Remove Baseline compilerDavid Brazdil2016-01-181-108/+41
| | | | | | | | | | | | | | We don't need Baseline any more and it hasn't been maintained for a while anyway. Let's remove it. Change-Id: I442ed26855527be2df3c79935403a25b1ee55df6
* | Move --dump-cfg and dump-cfg-append to CompilerOptions.Nicolas Geoffray2016-01-181-3/+3
|/ | | | | | It simplifies passing the option to the JIT. Change-Id: Iee1b722362899e5809ef97be90961e3dda1e16cc
* Merge "Implement irreducible loop support in optimizing."Nicolas Geoffray2016-01-141-8/+5
|\
| * Implement irreducible loop support in optimizing.Nicolas Geoffray2016-01-141-8/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | So we don't fallback to the interpreter in the presence of irreducible loops. Implications: - A loop pre-header does not necessarily dominate a loop header. - Non-constant redundant phis will be kept in loop headers, to satisfy our linear scan register allocation algorithm. - while-graph optimizations, such as gvn, licm, lse, and dce need to know when they are dealing with irreducible loops. Change-Id: I2cea8934ce0b40162d215353497c7f77d6c9137e
* | Add DWARF type information generation.Tamas Berghammer2016-01-131-1/+1
| | | | | | | | | | | | | | Emit native debugging information for types which are used during compilation. Change-Id: If28d19f60294494b7c6db8400d179494bebe9e61
* | Report DWARF debug information for JITed code.David Srbecky2016-01-131-0/+38
|/ | | | Change-Id: Ia5b2133c54386932c76c22774cf3d2ae61e0925f
* ART: Resolve ambiguous ArraySetsDavid Brazdil2016-01-061-2/+2
| | | | | | | | | | | Just like aget(-wide), the value operand of aput(-wide) bytecode instructions can be both int/long and float/double. This patch builds on the previous mechanism for resolving type of ArrayGets to type the values of ArraySets based on the reference type of the array. Bug: 22538329 Change-Id: Ic86abbb58de146692de04476b555010b6fcdd8b6
* Revert "Revert "Tweak inlining heuristics.""Nicolas Geoffray2016-01-041-1/+11
| | | | | | This reverts commit b17d1ccff0ac26fc22df671907ba2b4f4c656ce4. Change-Id: I26f6f8702a448c3da12662cbc6bc0f6e562bc40b