summaryrefslogtreecommitdiffstats
path: root/compiler/optimizing
Commit message (Collapse)AuthorAgeFilesLines
* Merge "Use Is*() helpers to shorten code in the optimizing compiler."Roland Levillain2014-10-137-19/+19
|\
| * Use Is*() helpers to shorten code in the optimizing compiler.Roland Levillain2014-10-097-19/+19
| | | | | | | | Change-Id: I79f31833bc9a0aa2918381aa3fb0b05d45f75689
* | Cleanup baseline register allocator.Nicolas Geoffray2014-10-109-181/+144
| | | | | | | | | | | | | | | | - Use three arrays for blocking regsters instead of one and computing offsets in that array.] - Don't pass blocked_registers_ to methods, just use the field. Change-Id: Ib698564c31127c59b5a64c80f4262394b8394dc6
* | Merge "Fix code generation of materialized conditions."Nicolas Geoffray2014-10-1014-152/+298
|\ \
| * | Fix code generation of materialized conditions.Nicolas Geoffray2014-10-0914-152/+298
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move the logic for knowing if a condition needs to be materialized in an optimization pass (so that the information does not change as a side effect of another optimization). Also clean-up arm and x86_64 codegen: - arm: ldr and str are for power-users when a constant is in play. We should use LoadFromOffset and StoreToOffset. - x86_64: fix misuses of movq instead of movl. Change-Id: I01a03b91803624be2281a344a13ad5efbf4f3ef3
* | | Enable -Wimplicit-fallthrough.Ian Rogers2014-10-093-12/+24
| | | | | | | | | | | | | | | | | | | | | | | | Falling through switch cases on a clang build must now annotate the fallthrough with the FALLTHROUGH_INTENDED macro. Bug: 17731372 Change-Id: I836451cd5f96b01d1ababdbf9eef677fe8fa8324
* | | stdint types all the way!Ian Rogers2014-10-091-11/+11
| |/ |/| | | | | Change-Id: I4e4ef3a2002fc59ebd9097087f150eaf3f2a7e08
* | Merge "Tidy ELF builder."Ian Rogers2014-10-096-6/+7
|\ \ | |/ |/|
| * Tidy ELF builder.Ian Rogers2014-10-096-6/+7
| | | | | | | | | | | | | | | | | | Don't do "if (ptr)". Use const. Use DISALLOW_COPY_AND_ASSIGN. Avoid public member variables. Move ValueObject to base and use in ELF builder. Tidy VectorOutputStream to not use non-const reference arguments. Change-Id: I2c727c3fc61769c3726de7cfb68b2d6eb4477e53
* | Stop converting from Location to ManagedRegister.Nicolas Geoffray2014-10-0916-580/+583
|/ | | | | | | Now the source of truth is the Location object that knows which register (core, pair, fpu) it needs to refer to. Change-Id: I62401343d7479ecfb24b5ed161ec7829cda5a0b1
* Header file clean up.Ian Rogers2014-10-083-3/+3
| | | | | | | | | | Remove runtime.h from object.h. Move TypeStaticIf to its own header file to avoid bringing utils.h into allocator.h. Move Array::DataOffset into -inl.h as it now has a utils.h dependency. Fix include issues arising from this. Change-Id: I4605b1aa4ff5f8dc15706a0132e15df03c7c8ba0
* Fix and improve static evaluation of constant expressions.Roland Levillain2014-10-082-41/+173
| | | | | | | | | | | | - Fix the definition of art::HSub::Evaluate. - Qualify Evaluate methods as OVERRIDE. - Evaluate comparisons in a deterministic way: if a comparison is true, always return 1 (instead of letting the compiler return any non-null value). - Better exercise static evaluation of constant expressions in compiler/optimizing/constant_propagation_test.cc. Change-Id: I13d0862e5f4eba1275016fb8c3c17e9aff54408b
* Add trivial register hints to the register allocator.Nicolas Geoffray2014-10-079-91/+482
| | | | | | | - Add hints for phis, same as first input, and expected registers. - Make the if instruction accept non-condition instructions. Change-Id: I34fa68393f0d0c19c68128f017b7a05be556fbe5
* Add support for floats and doubles.Nicolas Geoffray2014-10-0713-212/+514
| | | | | | | - Follows Quick conventions. - Currently only works with baseline register allocator. Change-Id: Ie4b8e298f4f5e1cd82364da83e4344d4fc3621a3
* Inserting a node must also update its inputs users.Nicolas Geoffray2014-10-072-3/+61
| | | | Change-Id: I55357564b81efcc0cf52fffdf23289696fe27dd1
* Merge "Do not use kDiesAtEntry when inputs must be in specific reg."Nicolas Geoffray2014-10-071-4/+12
|\
| * Do not use kDiesAtEntry when inputs must be in specific reg.Nicolas Geoffray2014-10-071-4/+12
| | | | | | | | | | | | | | | | The way the register allocator blocks registers currently does not handle these cases. Since it only applies to x86 for now, just ensure such requests cannot happen. Change-Id: Idfa25532b9b4996a192d05800f56c6e44edd3a8a
* | Add a prepare for register allocation pass.Nicolas Geoffray2014-10-0610-60/+251
|/ | | | | | | | | | - Currently the pass just changes the uses of checks to the actual values. - Also optimize array access, now that inputs can be constants. - And fix another bug in the register allocator reveiled by this change. Change-Id: I43be0dbde9330ee5c8f9d678de11361292d8bd98
* Add support for inputs dying at entry of instructions.Nicolas Geoffray2014-10-066-59/+87
| | | | | | | - Start using it in places where it makes sense. - Also improve suspend check on arm to use subs directly. Change-Id: I09ac0589f5ccb9b850ee757c76dcbcf35ee8cd01
* Merge "Revert "Introduce a class to implement optimization passes.""Nicolas Geoffray2014-10-0112-218/+65
|\
| * Revert "Introduce a class to implement optimization passes."Nicolas Geoffray2014-10-0112-218/+65
| | | | | | | | | | | | This reverts commit bf9cd7ba2118a75f5aa9b56241c4d5fa00dedeb8. Change-Id: I0a483446666c9c24c45925a5fc199debdefd8b3e
* | Merge "Introduce a class to implement optimization passes."Roland Levillain2014-10-0112-65/+218
|\ \ | |/
| * Introduce a class to implement optimization passes.Roland Levillain2014-10-0112-65/+218
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Add art::HOptimization. - Rename art::ConstantPropagation to art::HConstantFolding in compiler/optimizing/constant_folding.h to avoid name clashes with a class of the same name in compiler/dex/post_opt_passes.h. - Rename art::DeadCodeElimination to art::HDeadCodeElimination for consistency reasons. - Have art::HDeadCodeElimination and art::HConstantFolding derive from art::HOptimization. - Start to use these optimizations in art:OptimizingCompiler::TryCompile. Change-Id: Iaab350c122d87b2333b3760312b15c0592d7e010
* | Improve detection of lifetime holes.Nicolas Geoffray2014-09-305-9/+228
| | | | | | | | | | | | | | | | The check concluding that the next use was in a successor was too conservative: two blocks following each other in terms of liveness are not necessarily predecessor/sucessor. Change-Id: Ideec98046c812aa5fb63781141b5fde24c706d6d
* | Fix a bug in the insertion of parallel move.Nicolas Geoffray2014-09-294-24/+64
| | | | | | | | | | | | | | | | | | | | | | | | To make sure we do not connect interval siblings in the same parallel move, I added a new field in MoveOperands that tells for which instruction this move is for. A parallel move should not contains moves for the same instructions. The checks revealed a bug when connecting siblings, where we would choose the wrong parallel move. Change-Id: I70f27ec120886745c187071453c78da4c47c1dd2
* | Fix test now that instructions can die at instruction entry.Nicolas Geoffray2014-09-291-3/+3
| | | | | | | | Change-Id: I816279c55d12de8e69ac0b6c88730bd676c03335
* | Register allocator: refine instructions liveness.Nicolas Geoffray2014-09-273-15/+52
|/ | | | | | | | | Add support for instructions that die at the beginning of another instruction. Before, an instruction needed to stay alive during the instruction, so the register allocator was not able not reuse the register. Change-Id: I5f11a80b0a20778227229eb797816edcc6365297
* Make suspend checks note have side effects.Nicolas Geoffray2014-09-254-3/+4
| | | | | | Also adjust gtests. Change-Id: I5e1a3e53115812b45ec7f4b6f50ba468fa7ac6b1
* Merge "Optimize suspend checks in optimizing compiler."Nicolas Geoffray2014-09-2517-79/+349
|\
| * Optimize suspend checks in optimizing compiler.Nicolas Geoffray2014-09-2517-79/+349
| | | | | | | | | | | | | | | | | | | | - Remove the ones added during graph build (they were added for the baseline code generator). - Emit them at loop back edges after phi moves, so that the test can directly jump to the loop header. - Fix x86 and x86_64 suspend check by using cmpw instead of cmpl. Change-Id: I6fad5795a55705d86c9e1cb85bf5d63dadfafa2a
* | Merge "Optimizing compiler: remove unnecessary `explicit' keywords."Roland Levillain2014-09-256-13/+13
|\ \
| * | Optimizing compiler: remove unnecessary `explicit' keywords.Roland Levillain2014-09-256-13/+13
| |/ | | | | | | Change-Id: I5927fd92d53308c81e14edbd6e7d1c943bfa085b
* | Optimizing compiler: check inputs & uses definitions in CFG.Roland Levillain2014-09-253-0/+44
|/ | | | | | | Ensure each input and each use of an instruction is defined in a block of the control-flow graph. Change-Id: If4a83b02825230329b0b4fd84255dcb7c3219684
* Merge "Optimizing compiler: ensure loop header dominates loop's blocks."Roland Levillain2014-09-231-0/+15
|\
| * Optimizing compiler: ensure loop header dominates loop's blocks.Roland Levillain2014-09-231-0/+15
| | | | | | | | Change-Id: I6b2f1fdaac9f91dc5d9901cc2ad4c83745e90e70
* | Merge "Support for saving and restoring live registers in a slow path."Nicolas Geoffray2014-09-2313-19/+194
|\ \
| * | Support for saving and restoring live registers in a slow path.Nicolas Geoffray2014-09-2313-19/+194
| | | | | | | | | | | | | | | | | | And use it in suspend check slow paths. Change-Id: I79caf28f334c145a36180c79a6e2fceae3990c31
* | | Merge "Fix code generation with materialized conditions."Nicolas Geoffray2014-09-236-21/+57
|\ \ \
| * | | Fix code generation with materialized conditions.Nicolas Geoffray2014-09-236-21/+57
| | | | | | | | | | | | | | | | Change-Id: I8630af3c13fc1950d3fa718d7488407b00898796
* | | | Merge "Add loop- and phi-related checks in the optimizing compiler."Roland Levillain2014-09-234-7/+110
|\ \ \ \ | | |_|/ | |/| |
| * | | Add loop- and phi-related checks in the optimizing compiler.Roland Levillain2014-09-224-7/+110
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Ensure the pre-header block is first in the list of predecessors of a loop header. - Ensure the loop header has only two predecessors and that only the second one is the back edge. - Ensure there is only one back edge per loop. - Ensure the first input of a phi is not itself. - Ensure the number of phi inputs is the same as the number of its predecessors. - Ensure phi input at index I either comes from the Ith predecessor or from a block that dominates this predecessor. Change-Id: I4db5c68cfbc9b74d2d03125753d0143ece625378
* | | Also remove environment links to removed instructions.Nicolas Geoffray2014-09-223-4/+93
|/ / | | | | | | Change-Id: I505163fb8683269c7d3fe21b34df92337d244552
* | Fix a bug in the handling of moves in register allocator.Nicolas Geoffray2014-09-221-0/+4
| | | | | | | | Change-Id: Iaf1f34b0bece4f252290a97c3b73cc06e365985a
* | First optimization in new compiler: simple GVN.Nicolas Geoffray2014-09-197-2/+783
| | | | | | | | Change-Id: Ibe0efa4e84fd020a53ded310a92e0b4363f91b12
* | Merge "Initiate a constant propagation pass in the optimizing compiler."Roland Levillain2014-09-185-0/+635
|\ \
| * | Initiate a constant propagation pass in the optimizing compiler.Roland Levillain2014-09-185-0/+635
| | | | | | | | | | | | | | | | | | | | | | | | - Perform constant folding on int and long additions and subtractions in the optimizing compiler. - Apply constant folding to conditions and comparisons. Change-Id: Ic88783a3c975fda777c74c531e257fa777be42eb
* | | Fix a lint error and update a test after the phi fix.Nicolas Geoffray2014-09-182-7/+7
| | | | | | | | | | | | Change-Id: I6e9ab2a8300c2493a8d3e93ab4ced3d7c9552fc5
* | | Merge "Ensure the first predecessor of a loop is the pre header."Nicolas Geoffray2014-09-183-1/+20
|\ \ \ | |/ / |/| |
| * | Ensure the first predecessor of a loop is the pre header.Nicolas Geoffray2014-09-173-1/+20
| |/ | | | | | | | | | | | | | | | | | | | | Note that the check in ssa_phi_elimination.cc was very defensive: it does not affect the outcome of the algorithm whether the loop phi takes itself as the first input. It makes things consistent to always have the pre header as first input. Change-Id: Ic86248c1f38af67f7432782f6deefae1f4bf1ab6
* | Merge "It can be that no method has been compiled."Nicolas Geoffray2014-09-181-5/+9
|\ \