-
Notifications
You must be signed in to change notification settings - Fork 396
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow VP to remove/upgrade virtual guards with merged HCR/OSR guards #6762
Conversation
Allow folding (or for profiled guards, replacement by noppable guards) to proceed even if the guard in question is merged with an HCR or an OSR guard. Guards folded to always go to the cold side need no special handling. Guards folded to always go to the hot side (i.e. to fall through) have any merged HCR and/or OSR guard split out so that the virtual guard can be removed. When a profiled guard is replaced by a noppable guard, the noppable guard has the same merged HCR or OSR guard as the original profiled guard did, if any. Currently, this only affects guards that can be folded simply based on the value numbers or constraints of the children (e.g. mustBeEqual()), or guards that use VFT test or method test. The logic that folds nonoverridden guards has canFoldNonOverriddenGuard() check separately for canBeRemoved(). In principle it should be fine to relax that check too, but canFoldNonOverriddenGuard() is also used in constrainCall(), which instead of using removeConditionalBranch() has its own way of removing the guard. And it needs its own way. For example, it has to do TR::TransformUtil::removeTree(...), not vp->_curTree->setNode(NULL). It also might not be able to setUnreachablePath() on the edge. So to extend this improvement to the elimination of nonoverridden guards, some of this new logic will need to be factored out into its own function, and that work is left for the future.
The Mac failure is #6516:
|
@vijaysun-omr, would you mind reviewing? |
Yes I will look at it this afternoon |
I tried thinking of a case when the class that we use (from the inlined method) as the one to check redefinition for in the HCR guard may be the wrong one, but came to the conclusion that the method must be defined in the class that is mentioned on the call node or a superclass. In either case, it seemed like we would have the class mentioned in the call node be redefined (i.e. it is redefined itself OR a superclass is redefined but that should result in the subclasses getting redefined too). Since this is the core change in logic, I think it is good. |
Jenkins build all |
The PPC64LE Linux failure is #6571:
|
Failing checks are known/unrelated (as per comments) and review is done. Merging. |
Allow folding (or for profiled guards, replacement by noppable guards) to proceed even if the guard in question is merged with an HCR or an OSR guard. Guards folded to always go to the cold side need no special handling. Guards folded to always go to the hot side (i.e. to fall through) have any merged HCR and/or OSR guard split out so that the virtual guard can be removed. When a profiled guard is replaced by a noppable guard, the noppable guard has the same merged HCR or OSR guard as the original profiled guard did, if any.
Currently, this only affects guards that can be folded simply based on the value numbers or constraints of the children (e.g.
mustBeEqual()
), or guards that use VFT test or method test. The logic that folds nonoverridden guards hascanFoldNonOverriddenGuard()
check separately forcanBeRemoved()
. In principle it should be fine to relax that check too, butcanFoldNonOverriddenGuard()
is also used inconstrainCall()
, which instead of usingremoveConditionalBranch()
has its own way of removing the guard. And it needs its own way. For example, it has to doTR::TransformUtil::removeTree(...)
, notvp->_curTree->setNode(NULL)
. It also might not be able tosetUnreachablePath()
on the edge. So to extend this improvement to the elimination of nonoverridden guards, some of this new logic will need to be factored out into its own function, and that work is left for the future.