Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: a7e06756879026db26e3c9aff2f0f7f98d518031
      
https://github.com/WebKit/WebKit/commit/a7e06756879026db26e3c9aff2f0f7f98d518031
  Author: Dan Hecht <[email protected]>
  Date:   2025-02-20 (Thu, 20 Feb 2025)

  Changed paths:
    M Source/JavaScriptCore/b3/air/AirAllocateRegistersByGreedy.cpp

  Log Message:
  -----------
  [JSC][GreedyRegAlloc] Fix corner cases in buildLiveRanges
https://bugs.webkit.org/show_bug.cgi?id=288105
rdar://145064388

Reviewed by Yijia Huang.

buildLiveRanges() needs to be more deliberate about how it models
an instruction. It should process the effects in order rather than
how they happen to occur in the arg list (though usually things
worked out okay with arg list order). Otherwise, the following
issues can occur:

1. If %tmpA is late-def & %tmpB is late-use (or similarly early-def & 
early-use),
   pruneCoalescable() needs to see this interference, otherwise an incorrect tmp
   coalescing could occur.
2. If %tmpA is both early-use and late-def, then the late-def must
   not kill the early-use.
3. Similarly, if %tmpA is both early-def and late-use (e.g. scratch), then
   if processed in the wrong order, the lifetime of A may extend earlier
   than it should (potential performance issue, not correctness).
4. if %tmpA and %tmpB are both def at the same point (either early or late)
   and one of them is a dead def (has no subsequent use) then pruneCoalescable()
   needs to handle def-def interference for dead defs. In the case of a dead 
def,
   the interval will not be "active" since there was no subsequent use to open 
it,
   and so we need to check first closed (i.e. last to be closed) interval for
   interference. This will be more important if the clobber logic is folded
   into the main use-def logic.

* Source/JavaScriptCore/b3/air/AirAllocateRegistersByGreedy.cpp:
(JSC::B3::Air::Greedy::GreedyAllocator::buildLiveRanges):

Canonical link: https://commits.webkit.org/290729@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to