]> Cypherpunks repositories - gostls13.git/commit
cmd/compile/internal/liveness: introduce "live intervals" utility
authorThan McIntosh <thanm@google.com>
Thu, 22 Feb 2024 14:06:28 +0000 (14:06 +0000)
committerThan McIntosh <thanm@google.com>
Fri, 29 Mar 2024 21:55:27 +0000 (21:55 +0000)
commit7979c8f5881b5ab183acc096f33dfcb1cab995fa
treee7c9f1a3437287270982cd8acd222c1e5d80e1ef
parent593daf785f5afc8106dd0b17fcad84c9627e5fae
cmd/compile/internal/liveness: introduce "live intervals" utility

Introduce a helper type "Intervals" that contains sets of sorted
disjoint ranges corresponding to live ranges within a function.
Example: the Intervals set "{ [0,1), [4,10) }" would indicate that
something is live starting at instruction 0, then up to but not
including instruction 1, then dead from 1-3, then live again at
instruction 4 up to (but not including) instruction 10.

This patch provides APIs for constructing interval sets, testing to
see whether two sets overlap, and unioning/merging together two
intervals sets.

Updates #62737.
Updates #65532.
Updates #65495.

Change-Id: I7140a5989eba93bf3b8762d9224261f5eba0646d
Reviewed-on: https://go-review.googlesource.com/c/go/+/566177
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
src/cmd/compile/internal/liveness/intervals.go [new file with mode: 0644]
src/cmd/compile/internal/liveness/intervals_test.go [new file with mode: 0644]