History log of /art/compiler/optimizing/gvn.cc
Revision Date Author Comments
77ce6430af2709432b22344ed656edd8ec80581b 10-May-2016 Nicolas Geoffray <ngeoffray@google.com> Fix another case of live_in at irreducible loop entry.

GVN was implicitly extending the liveness of an instruction across
an irreducible loop.

Fix this problem by clearing the value set at loop entries that contain
an irreducible loop.

bug:28252896
Change-Id: I68823cb88dceb4c2b4545286ba54fd0c958a48b0
d9743790f64d7f37eb549a45c724331182369a98 21-Apr-2016 David Brazdil <dbrazdil@google.com> ART: Address late comments on a GVN memory-saving CL

Added extra comments and removed redundant code as requested.

Bug: 28173563
Bug: 28287086

Change-Id: If6aff68c4c30427a86a27ffba5df1ae135edd294
(cherry picked from commit 94408d3144061bd6efc74b3d884d38169969c63f)
4283aa9fd085d7d9a46e016cd68018d10135841f 20-Apr-2016 David Brazdil <dbrazdil@google.com> Reduce memory usage in GVN

Implement recycling of ValueSet data structures which the GVN
algorithm will not access any more.

Savings depend on the shape of the graph, but can be as high as 93%.
Peak memory usage for GSA drops from 32MB to 26MB, compile times seem
unaffected.

Bug: 28173563
Bug: 28287086

Change-Id: If227177449bc90ad24fa68c37b0c2615924af1ed
(cherry picked from commit cc857cfbe4a179dfa7935b7334f1efbb21f2ac76)
f6a35de9eeefb20f6446f1b4815b4dcb0161d09c 21-Mar-2016 Vladimir Marko <vmarko@google.com> Optimizing: Fix register allocator validation memory usage.

Also attribute ArenaBitVector allocations to appropriate
passes. This was used to track down the source of the
excessive memory alloactions.

Bug: 27690481

Change-Id: Ib895984cb7c04e24cbc7abbd8322079bab8ab100
15bd22849ee6a1ffb3fb3630f686c2870bdf1bbc 05-Jan-2016 Nicolas Geoffray <ngeoffray@google.com> Implement irreducible loop support in optimizing.

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
729645a937eb9f04a311b3c22471dcf3ebe9bcec 19-Nov-2015 Nicolas Geoffray <ngeoffray@google.com> Explicitly add HLoadClass/HClinitCheck for HNewInstance.

bug:25735083
bug:25173758

Change-Id: Ie81cfa4fa9c47cc025edb291cdedd7af209a03db
e5d80f83ae53792bc1eebd4e33e4e99f7c031b0c 16-Oct-2015 Mathieu Chartier <mathieuc@google.com> Move ArenaBitVector into the runtime

Motivation is using arenas in the verifier.

Bug: 10921004
Change-Id: I3c7ed369194b2309a47b12a621e897e0f2f65fcf
ec7802a102d49ab5c17495118d4fe0bcc7287beb 01-Oct-2015 Vladimir Marko <vmarko@google.com> Add DCHECKs to ArenaVector and ScopedArenaVector.

Implement dchecked_vector<> template that DCHECK()s element
access and insert()/emplace()/erase() positions. Change the
ArenaVector<> and ScopedArenaVector<> aliases to use the new
template instead of std::vector<>. Remove DCHECK()s that
have now become unnecessary from the Optimizing compiler.

Change-Id: Ib8506bd30d223f68f52bd4476c76d9991acacadc
5233f93ee336b3581ccdb993ff6342c52fec34b0 29-Sep-2015 Vladimir Marko <vmarko@google.com> Optimizing: Tag even more arena allocations.

Tag previously "Misc" arena allocations with more specific
allocation types. Move some native heap allocations to the
arena in BCE.

Bug: 23736311
Change-Id: If8ef15a8b614dc3314bdfb35caa23862c9d4d25c
2aaa4b5532d30c4e65d8892b556400bb61f9dc8c 17-Sep-2015 Vladimir Marko <vmarko@google.com> Optimizing: Tag more arena allocations.

Replace GrowableArray with ArenaVector and tag arena
allocations with new allocation types.

As part of this, make the register allocator a bit more
efficient, doing bulk insert/erase. Some loops are now
O(n) instead of O(n^2).

Change-Id: Ifac0871ffb34b121cc0447801a2d07eefd308c14
fa6b93c4b69e6d7ddfa2a4ed0aff01b0608c5a3a 15-Sep-2015 Vladimir Marko <vmarko@google.com> Optimizing: Tag arena allocations in HGraph.

Replace GrowableArray with ArenaVector in HGraph and related
classes HEnvironment, HLoopInformation, HInvoke and HPhi,
and tag allocations with new arena allocation types.

Change-Id: I3d79897af405b9a1a5b98bfc372e70fe0b3bc40d
6058455d486219994921b63a2d774dc9908415a2 03-Sep-2015 Vladimir Marko <vmarko@google.com> Optimizing: Tag basic block allocations with their source.

Replace GrowableArray with ArenaVector in HBasicBlock and,
to track the source of allocations, assign one new and two
Quick's arena allocation types to these vectors. Rename
kArenaAllocSuccessor to kArenaAllocSuccessors.

Bug: 23736311
Change-Id: Ib52e51698890675bde61f007fe6039338cf1a025
145acc5361deb769eed998f057bc23abaef6e116 03-Sep-2015 Vladimir Marko <vmarko@google.com> Revert "Optimizing: Tag basic block allocations with their source."

Reverting so that we can have more discussion about the STL API.

This reverts commit 91e11c0c840193c6822e66846020b6647de243d5.

Change-Id: I187fe52f2c16b6e7c5c9d49c42921eb6c7063dba
91e11c0c840193c6822e66846020b6647de243d5 02-Sep-2015 Vladimir Marko <vmarko@google.com> Optimizing: Tag basic block allocations with their source.

Replace GrowableArray with ArenaVector in HBasicBlock and,
to track the source of allocations, assign one new and two
Quick's arena allocation types to these vectors. Rename
kArenaAllocSuccessor to kArenaAllocSuccessors.

Bug: 23736311
Change-Id: I984aef6e615ae2380a532f5c6726af21015f43f5
78e3ef6bc5f8aa149f2f8bf0c78ce854c2f910fa 12-Aug-2015 Alexandre Rames <alexandre.rames@linaro.org> Add a GVN dependency 'GC' for garbage collection.

This will be used by incoming architecture specific optimizations. The
dependencies must be conservative. When an HInstruction is created we
may not be sure whether it can trigger GC. In that case the
'ChangesGC' dependency must be set. We control at code-generation time
that HInstructions that can call have the 'ChangesGC' dependency
set.

Change-Id: Iea6a7f430009f37a9599b0a0039207049906e45d
854a02b1b488327f80c544ca1119b386b8715c26 15-Jul-2015 Aart Bik <ajcbik@google.com> Improved side effect analysis (field/array write/read).

Rationale:
Types (int, float etc.) and access type (field vs. array)
can be used to disambiguate write/read side-effects analysis.
This directly improves e.g. dead code elimination and licm.

Change-Id: I371f6909a3f42bda13190a03f04c4a867bde1d06
2cebb24bfc3247d3e9be138a3350106737455918 22-Apr-2015 Mathieu Chartier <mathieuc@google.com> Replace NULL with nullptr

Also fixed some lines that were too long, and a few other minor
details.

Change-Id: I6efba5fb6e03eb5d0a300fddb2a75bf8e2f175cb
6d340c4f16f374e05f4205e5a27de1174abcaf2a 03-Mar-2015 David Brazdil <dbrazdil@google.com> ART: Faster implementation of GVN's hash table

The basic hash table in Optimizing's GVN pass does not scale for
larger methods and quickly becomes a bottleneck. This patch provides
a different implementation, focusing on the following:
(1) Proper buckets with chaining for near constant-time lookup.
(2) Bucket inheritance for faster cloning. A clone does not actually
copy the entries until a first change is made.
(3) Table resizing for better load management. Done during cloning.
(4) Kill() and IntersectWith() applied only on impure instructions.
This is achieved by splitting (im)pure entries between even- and
odd-indexed buckets.

Benchmarks show that this optimization speeds up GVN by ~10%, which
translates to a rougly 2% change in the overall compilation time.

Change-Id: Ib4058359701d990194cfd49c6ee46ac2372f090c
dc5ac731f6369b53b42f1cee3404f3b3384cec34 25-Feb-2015 Mingyao Yang <mingyao@google.com> Opt compiler: enhance gvn for commutative ops.

Change-Id: I415b50d58b30cab4ec38077be22373eb9598ec40
433be7f82e4c3433da718a739f9e738410727ca3 23-Feb-2015 David Brazdil <dbrazdil@google.com> Optimizing: Remove redundant hash set copy in GVN

During the GVN analysis, a basic block inherits the set of movable
instructions from its dominator. If the block is the only successor
of the dominating block, there is no need for cloning of the parent
set (a very expensive operation).

Change-Id: I59e033b9e9e093984dc8e903e3a7be1cb3645cc2
827eedbfa882496407375f22b08243a38a5bd53b 26-Jan-2015 Nicolas Geoffray <ngeoffray@google.com> Move code around and address growable_array comment.

- Move SideEffectsAnalysis to its own file.
- Move most of gvn.h to gvn.cc.
- Don't call Resize in GrowableArray constructor, but just set num_used
directly.

Change-Id: I1f1291207945d678d3c99cc0ec1ec155bcae82f6
86dde1658a1951c251dd5c6ff21ecc5c281879a6 26-Jan-2015 Nicolas Geoffray <ngeoffray@google.com> Introduce a SideEffectsAnalysis class.

LICM also needs the side effects information of loops, so move
the GVN::ComputeSideEffects method into its own analysis class.

Change-Id: I810c8230a0eb6b9b536e8f808e17a3a4ad72f7db
dbca6fae9d09160f45bf8d3512f15cdd9558975b 27-Nov-2014 Nicolas Geoffray <ngeoffray@google.com> Fix a bug in GVN.

When a predecessor block was killing instructions in a set, we were
not taking into account side effects of blocks between the dominator to
this predecessor.

Implementation now intersects the copied set of the dominator with
the predecessors to take these side effects into account.

Change-Id: If297439cc4e50cee91e9fffd028216a3e49e19ef
277ccbd200ea43590dfc06a93ae184a765327ad0 04-Nov-2014 Andreas Gampe <agampe@google.com> ART: More warnings

Enable -Wno-conversion-null, -Wredundant-decls and -Wshadow in general,
and -Wunused-but-set-parameter for GCC builds.

Change-Id: I81bbdd762213444673c65d85edae594a523836e5
d31cf3d55a0847c018c4eaa2b349b8eea509de64 08-Sep-2014 Nicolas Geoffray <ngeoffray@google.com> First optimization in new compiler: simple GVN.

Change-Id: Ibe0efa4e84fd020a53ded310a92e0b4363f91b12