RFR: 8253524: C2: Refactor code that clones predicates during loop unswitching
Christian Hagedorn
chagedorn at openjdk.java.net
Wed Sep 23 12:01:39 UTC 2020
On Wed, 23 Sep 2020 08:30:45 GMT, Roland Westrelin <roland at openjdk.org> wrote:
> During unswitching, PhaseIdealLoop::create_slow_version_of_loop()
> calls PhaseIdealLoop::clone_predicates_to_unswitched_loop() twice, one
> for each loops, to clone some predicates above each loop. That code is
> fragile as it (implicitly) requires the fast loop to be processed
> first. I propose calling
> PhaseIdealLoop::clone_predicates_to_unswitched_loop() a single time
> and have it handle both loops in a single pass.
Very nice clean-up! This makes it much easier. Apart from some minor code style comments, it looks good to me!
src/hotspot/share/opto/loopPredicate.cpp line 233:
> 231: // 'new_predicate_proj' and rewires the control edges of data nodes in
> 232: // the loop from the old predicates to the new cloned predicates.
> 233: void PhaseIdealLoop::clone_skeleton_predicates_to_unswitched_loop(IdealLoopTree *loop, const Node_List &old_new,
> Deoptimization::DeoptReason reason,
Asterisk: `IdealLoopTree*`
src/hotspot/share/opto/loopnode.hpp line 1438:
> 1436: void clone_skeleton_predicates_to_unswitched_loop(IdealLoopTree *loop, const Node_List &old_new,
> Deoptimization::DeoptReason reason, 1437: ProjNode* old_predicate_proj, ProjNode*
> iffast, ProjNode* ifslow); 1438: void check_created_predicate_for_unswitching(const Node *new_entry) const
> PRODUCT_RETURN;
Move the asterisks to the types.
src/hotspot/share/opto/loopPredicate.cpp line 350:
> 348:
> 349: #ifndef PRODUCT
> 350: void PhaseIdealLoop::check_created_predicate_for_unswitching(const Node *new_entry) const {
Asterisk: `Node*`
-------------
Changes requested by chagedorn (Reviewer).
PR: https://git.openjdk.java.net/jdk/pull/317
More information about the hotspot-compiler-dev
mailing list