diff options
author | 2022-03-04 10:13:10 +0000 | |
---|---|---|
committer | 2022-03-28 11:17:34 +0100 | |
commit | 8d100bab7f9d93e7a83bfd2fe0829092d8f22aa0 (patch) | |
tree | 352a1b0d71ff76de4567960f7e19834b71a89b7e /compiler/optimizing/nodes.h | |
parent | d5d11d9dae9b8cb7149c2aed6a9da977b87767b7 (diff) |
Fix last value generation in loop optimization.
Instead of `in_body`, propagate the context block and loop
information to make better decisions for trip count if the
context is outside the loop.
In particular, fix `InductionVarRange::IsConstant()` to take
and use this information instead of assuming that we are
asking about values in the loop body.
For trip count with context outside the loop, we know that
the value shall be the maximum trip count if the context
is dominated by the loop control exit block.
Test: Enable run-test 835-b216762268.
Test: m test-art-host-gtest
Test: testrunner.py --host --optimizing
Bug: 216762268
Change-Id: Id564ba75c812d54abdd9b229e643cc8ab4701c52
Diffstat (limited to 'compiler/optimizing/nodes.h')
-rw-r--r-- | compiler/optimizing/nodes.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/optimizing/nodes.h b/compiler/optimizing/nodes.h index 42f03a0bc7..7a0059f616 100644 --- a/compiler/optimizing/nodes.h +++ b/compiler/optimizing/nodes.h @@ -1417,7 +1417,7 @@ class HBasicBlock : public ArenaObject<kArenaAllocBasicBlock> { bool HasThrowingInstructions() const; // Returns whether this block dominates the blocked passed as parameter. - bool Dominates(HBasicBlock* block) const; + bool Dominates(const HBasicBlock* block) const; size_t GetLifetimeStart() const { return lifetime_start_; } size_t GetLifetimeEnd() const { return lifetime_end_; } |