[go] cmd/compile: optimize sccp for faster convergence

8 views
Skip to first unread message

Gerrit Bot (Gerrit)

unread,
Feb 2, 2026, 12:17:14 AMFeb 2
to goph...@pubsubhelper.golang.org, Yi Yang, golang-co...@googlegroups.com

Gerrit Bot has uploaded the change for review

Commit message

cmd/compile: optimize sccp for faster convergence

While investigating other optimizations, I found several opportunities to accelerate sccp convergence.

- avoid adding duplicate ueses to the re-visit worklist
- prevent queueing uses of values that have already reached Bottom
- add an early exit when processing a value that is already Bottom

These changes provide an overall speedup of ~9% for sccp during a full make.bash run

Updates #77325
Change-Id: Iaf83f6ea355eed366c3d09fc38f85561634a5a16
GitHub-Last-Rev: b3fc7b9b25fc81e5969374f5777243938216c71f
GitHub-Pull-Request: golang/go#77399

Change diff

diff --git a/src/cmd/compile/internal/ssa/sccp.go b/src/cmd/compile/internal/ssa/sccp.go
index ecc0f94..613b0ff 100644
--- a/src/cmd/compile/internal/ssa/sccp.go
+++ b/src/cmd/compile/internal/ssa/sccp.go
@@ -54,6 +54,7 @@
type worklist struct {
f *Func // the target function to be optimized out
edges []Edge // propagate constant facts through edges
+ inUses *sparseSet // IDs already in uses, for duplicate check
uses []*Value // re-visiting set
visited map[Edge]bool // visited edges
latticeCells map[*Value]lattice // constant lattices
@@ -75,6 +76,8 @@
t.defBlock = make(map[*Value][]*Block)
t.latticeCells = make(map[*Value]lattice)
t.visitedBlock = f.Cache.allocBoolSlice(f.NumBlocks())
+ t.inUses = f.newSparseSet(f.NumValues())
+ defer f.retSparseSet(t.inUses)
defer f.Cache.freeBoolSlice(t.visitedBlock)

// build it early since we rely heavily on the def-use chain later
@@ -108,6 +111,7 @@
if len(t.uses) > 0 {
use := t.uses[0]
t.uses = t.uses[1:]
+ t.inUses.remove(use.ID)
t.visitValue(use)
continue
}
@@ -274,12 +278,20 @@
// addUses finds all uses of value and appends them into work list for further process
func (t *worklist) addUses(val *Value) {
for _, use := range t.defUse[val] {
+ // Phi may refer to itself as uses, avoid duplicate visits
if val == use {
- // Phi may refer to itself as uses, ignore them to avoid re-visiting phi
- // for performance reason
continue
}
- t.uses = append(t.uses, use)
+ // Provenly not a constant, ignore
+ useLt := t.getLatticeCell(use)
+ if useLt.tag == bottom {
+ continue
+ }
+ // Avoid duplicate visits
+ if !t.inUses.contains(use.ID) {
+ t.inUses.add(use.ID)
+ t.uses = append(t.uses, use)
+ }
}
for _, block := range t.defBlock[val] {
if t.visitedBlock[block.ID] {
@@ -366,15 +378,19 @@
}

func (t *worklist) visitValue(val *Value) {
+ // Impossible to be a constant, fast fail
if !possibleConst(val) {
- // fast fail for always worst Values, i.e. there is no lowering happen
- // on them, their lattices must be initially worse Bottom.
return
}

+ // Provenly not a constant, fast fail
oldLt := t.getLatticeCell(val)
+ if oldLt.tag == bottom {
+ return
+ }
+
+ // Re-visit all uses of value if its lattice is changed
defer func() {
- // re-visit all uses of value if its lattice is changed
newLt := t.getLatticeCell(val)
if !equals(newLt, oldLt) {
if int8(oldLt.tag) > int8(newLt.tag) {

Change information

Files:
  • M src/cmd/compile/internal/ssa/sccp.go
Change size: S
Delta: 1 file changed, 22 insertions(+), 6 deletions(-)
Open in Gerrit

Related details

Attention set is empty
Submit Requirements:
  • requirement is not satisfiedCode-Review
  • requirement satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
  • requirement is not satisfiedTryBots-Pass
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: newchange
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: Iaf83f6ea355eed366c3d09fc38f85561634a5a16
Gerrit-Change-Number: 740980
Gerrit-PatchSet: 1
Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
Gerrit-CC: Yi Yang <qingf...@alibaba-inc.com>
unsatisfied_requirement
satisfied_requirement
open
diffy

Gopher Robot (Gerrit)

unread,
Feb 2, 2026, 12:17:14 AMFeb 2
to Yi Yang, Gerrit Bot, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

Gopher Robot added 1 comment

Patchset-level comments
File-level comment, Patchset 1 (Latest):
Gopher Robot . unresolved

I spotted some possible problems with your PR:

  1. You have a long 102 character line in the commit message body. Please add line breaks to long lines that should be wrapped. Lines in the commit message body should be wrapped at ~76 characters unless needed for things like URLs or tables. (Note: GitHub might render long lines as soft-wrapped, so double-check in the Gerrit commit message shown above.)

Please address any problems by updating the GitHub PR.

When complete, mark this comment as 'Done' and click the [blue 'Reply' button](https://go.dev/wiki/GerritBot#i-left-a-reply-to-a-comment-in-gerrit-but-no-one-but-me-can-see-it) above. These findings are based on heuristics; if a finding does not apply, briefly reply here saying so.

To update the commit title or commit message body shown here in Gerrit, you must edit the GitHub PR title and PR description (the first comment) in the GitHub web interface using the 'Edit' button or 'Edit' menu entry there. Note: pushing a new commit to the PR will not automatically update the commit message used by Gerrit.

For more details, see:

(In general for Gerrit code reviews, the change author is expected to [log in to Gerrit](https://go-review.googlesource.com/login/) with a Gmail or other Google account and then close out each piece of feedback by marking it as 'Done' if implemented as suggested or otherwise reply to each review comment. See the [Review](https://go.dev/doc/contribute#review) section of the Contributing Guide for details.)

Open in Gerrit

Related details

Attention set is empty
Submit Requirements:
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    • requirement is not satisfiedTryBots-Pass
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: go
    Gerrit-Branch: master
    Gerrit-Change-Id: Iaf83f6ea355eed366c3d09fc38f85561634a5a16
    Gerrit-Change-Number: 740980
    Gerrit-PatchSet: 1
    Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
    Gerrit-CC: Gopher Robot <go...@golang.org>
    Gerrit-CC: Yi Yang <qingf...@alibaba-inc.com>
    Gerrit-Comment-Date: Mon, 02 Feb 2026 05:17:10 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    unsatisfied_requirement
    open
    diffy

    Gerrit Bot (Gerrit)

    unread,
    Feb 2, 2026, 12:26:43 AMFeb 2
    to Yi Yang, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

    Gerrit Bot uploaded new patchset

    Gerrit Bot uploaded patch set #2 to this change.
    Open in Gerrit

    Related details

    Attention set is empty
    Submit Requirements:
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    • requirement is not satisfiedTryBots-Pass
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: newpatchset
    Gerrit-Project: go
    Gerrit-Branch: master
    Gerrit-Change-Id: Iaf83f6ea355eed366c3d09fc38f85561634a5a16
    Gerrit-Change-Number: 740980
    Gerrit-PatchSet: 2
    unsatisfied_requirement
    open
    diffy

    Yi Yang (Gerrit)

    unread,
    Feb 2, 2026, 12:28:20 AMFeb 2
    to Gerrit Bot, goph...@pubsubhelper.golang.org, Keith Randall, Martin Möhrmann, Gopher Robot, golang-co...@googlegroups.com
    Attention needed from Keith Randall and Martin Möhrmann

    Yi Yang added 1 comment

    Patchset-level comments
    File-level comment, Patchset 1:
    Gopher Robot . resolved

    I spotted some possible problems with your PR:

      1. You have a long 102 character line in the commit message body. Please add line breaks to long lines that should be wrapped. Lines in the commit message body should be wrapped at ~76 characters unless needed for things like URLs or tables. (Note: GitHub might render long lines as soft-wrapped, so double-check in the Gerrit commit message shown above.)

    Please address any problems by updating the GitHub PR.

    When complete, mark this comment as 'Done' and click the [blue 'Reply' button](https://go.dev/wiki/GerritBot#i-left-a-reply-to-a-comment-in-gerrit-but-no-one-but-me-can-see-it) above. These findings are based on heuristics; if a finding does not apply, briefly reply here saying so.

    To update the commit title or commit message body shown here in Gerrit, you must edit the GitHub PR title and PR description (the first comment) in the GitHub web interface using the 'Edit' button or 'Edit' menu entry there. Note: pushing a new commit to the PR will not automatically update the commit message used by Gerrit.

    For more details, see:

    (In general for Gerrit code reviews, the change author is expected to [log in to Gerrit](https://go-review.googlesource.com/login/) with a Gmail or other Google account and then close out each piece of feedback by marking it as 'Done' if implemented as suggested or otherwise reply to each review comment. See the [Review](https://go.dev/doc/contribute#review) section of the Contributing Guide for details.)

    Yi Yang

    Done

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Keith Randall
    • Martin Möhrmann
    Submit Requirements:
      • requirement is not satisfiedCode-Review
      • requirement satisfiedNo-Unresolved-Comments
      • requirement is not satisfiedReview-Enforcement
      • requirement is not satisfiedTryBots-Pass
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: Iaf83f6ea355eed366c3d09fc38f85561634a5a16
      Gerrit-Change-Number: 740980
      Gerrit-PatchSet: 2
      Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
      Gerrit-Reviewer: Keith Randall <k...@golang.org>
      Gerrit-Reviewer: Martin Möhrmann <moeh...@google.com>
      Gerrit-CC: Gopher Robot <go...@golang.org>
      Gerrit-CC: Yi Yang <qingf...@alibaba-inc.com>
      Gerrit-Attention: Keith Randall <k...@golang.org>
      Gerrit-Attention: Martin Möhrmann <moeh...@google.com>
      Gerrit-Comment-Date: Mon, 02 Feb 2026 05:28:12 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Gopher Robot <go...@golang.org>
      unsatisfied_requirement
      satisfied_requirement
      open
      diffy

      Jorropo (Gerrit)

      unread,
      Feb 2, 2026, 2:48:03 AMFeb 2
      to Yi Yang, Gerrit Bot, goph...@pubsubhelper.golang.org, Keith Randall, Martin Möhrmann, Gopher Robot, golang-co...@googlegroups.com
      Attention needed from Keith Randall and Martin Möhrmann

      Jorropo voted and added 4 comments

      Votes added by Jorropo

      Commit-Queue+1

      4 comments

      Patchset-level comments
      Commit Message
      Line 20, Patchset 2 (Latest):Updates #77325
      Jorropo . unresolved

      That number looks wrong:
      > optimize string concatenation to avoid runtime calls

      File src/cmd/compile/internal/ssa/sccp.go
      Line 57, Patchset 2 (Latest): inUses *sparseSet // IDs already in uses, for duplicate check
      Jorropo . unresolved

      It looks to me like you want to use a bitset instead.

      Since SCCP visits most values in the function and you want to store one bit per value.
      (value IDs are dense)

      Line 60, Patchset 2 (Latest): latticeCells map[*Value]lattice // constant lattices
      Jorropo . unresolved

      If you want an other optimization to try all the maps in this struct shouldn't be maps.

      You can use the assumption that IDs are dense (thanks to the ID allocator and value cache).
      And theses should be slices indexed by `val.ID`.

      The only slightly involved change is `latticeCells` since it ranges over the map and there is no simple `id` → `*Value` lookup (a simple fix is to use a type like `[]struct{v *Value; l lattice}`).

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Keith Randall
      • Martin Möhrmann
      Submit Requirements:
        • requirement is not satisfiedCode-Review
        • requirement is not satisfiedNo-Unresolved-Comments
        • requirement is not satisfiedReview-Enforcement
        • requirement is not satisfiedTryBots-Pass
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: comment
        Gerrit-Project: go
        Gerrit-Branch: master
        Gerrit-Change-Id: Iaf83f6ea355eed366c3d09fc38f85561634a5a16
        Gerrit-Change-Number: 740980
        Gerrit-PatchSet: 2
        Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
        Gerrit-Reviewer: Jorropo <jorro...@gmail.com>
        Gerrit-Reviewer: Keith Randall <k...@golang.org>
        Gerrit-Reviewer: Martin Möhrmann <moeh...@google.com>
        Gerrit-CC: Gopher Robot <go...@golang.org>
        Gerrit-CC: Yi Yang <qingf...@alibaba-inc.com>
        Gerrit-Attention: Keith Randall <k...@golang.org>
        Gerrit-Attention: Martin Möhrmann <moeh...@google.com>
        Gerrit-Comment-Date: Mon, 02 Feb 2026 07:47:55 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: Yes
        unsatisfied_requirement
        open
        diffy

        Yi Yang (Gerrit)

        unread,
        Feb 2, 2026, 8:55:29 PMFeb 2
        to Gerrit Bot, goph...@pubsubhelper.golang.org, Go LUCI, Jorropo, Keith Randall, Martin Möhrmann, Gopher Robot, golang-co...@googlegroups.com
        Attention needed from Jorropo, Keith Randall and Martin Möhrmann

        Yi Yang added 3 comments

        Commit Message
        Jorropo . resolved

        That number looks wrong:
        > optimize string concatenation to avoid runtime calls

        Yi Yang

        I'm referencing #77325 as this patch is a prerequisite for it.

        File src/cmd/compile/internal/ssa/sccp.go
        Line 57, Patchset 2 (Latest): inUses *sparseSet // IDs already in uses, for duplicate check
        Jorropo . unresolved

        It looks to me like you want to use a bitset instead.

        Since SCCP visits most values in the function and you want to store one bit per value.
        (value IDs are dense)

        Yi Yang

        SCCP is sparse, it only visits a small number of values, not most of them.

        Do you mean I should use a `uses []*Value` slice indexed by val.ID, instead of the inUses+uses combination?

        Line 60, Patchset 2 (Latest): latticeCells map[*Value]lattice // constant lattices
        Jorropo . resolved

        If you want an other optimization to try all the maps in this struct shouldn't be maps.

        You can use the assumption that IDs are dense (thanks to the ID allocator and value cache).
        And theses should be slices indexed by `val.ID`.

        The only slightly involved change is `latticeCells` since it ranges over the map and there is no simple `id` → `*Value` lookup (a simple fix is to use a type like `[]struct{v *Value; l lattice}`).

        Yi Yang

        I suspect `visited map[Edge]bool` is the main performance bottleneck here. We could probably replace it with a slice later on. The others seem less critical.

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Jorropo
        • Keith Randall
        • Martin Möhrmann
        Submit Requirements:
        • requirement is not satisfiedCode-Review
        • requirement is not satisfiedNo-Unresolved-Comments
        • requirement is not satisfiedReview-Enforcement
        • requirement is not satisfiedTryBots-Pass
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: comment
        Gerrit-Project: go
        Gerrit-Branch: master
        Gerrit-Change-Id: Iaf83f6ea355eed366c3d09fc38f85561634a5a16
        Gerrit-Change-Number: 740980
        Gerrit-PatchSet: 2
        Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
        Gerrit-Reviewer: Jorropo <jorro...@gmail.com>
        Gerrit-Reviewer: Keith Randall <k...@golang.org>
        Gerrit-Reviewer: Martin Möhrmann <moeh...@google.com>
        Gerrit-CC: Gopher Robot <go...@golang.org>
        Gerrit-CC: Yi Yang <qingf...@alibaba-inc.com>
        Gerrit-Attention: Keith Randall <k...@golang.org>
        Gerrit-Attention: Jorropo <jorro...@gmail.com>
        Gerrit-Attention: Martin Möhrmann <moeh...@google.com>
        Gerrit-Comment-Date: Tue, 03 Feb 2026 01:55:20 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        Comment-In-Reply-To: Jorropo <jorro...@gmail.com>
        unsatisfied_requirement
        open
        diffy

        Yi Yang (Gerrit)

        unread,
        Feb 2, 2026, 8:59:06 PMFeb 2
        to Gerrit Bot, goph...@pubsubhelper.golang.org, Go LUCI, Jorropo, Keith Randall, Martin Möhrmann, Gopher Robot, golang-co...@googlegroups.com
        Attention needed from Jorropo, Keith Randall and Martin Möhrmann

        Yi Yang added 1 comment

        File src/cmd/compile/internal/ssa/sccp.go
        Line 57, Patchset 2 (Latest): inUses *sparseSet // IDs already in uses, for duplicate check
        Jorropo . unresolved

        It looks to me like you want to use a bitset instead.

        Since SCCP visits most values in the function and you want to store one bit per value.
        (value IDs are dense)

        Yi Yang

        SCCP is sparse, it only visits a small number of values, not most of them.

        Do you mean I should use a `uses []*Value` slice indexed by val.ID, instead of the inUses+uses combination?

        Yi Yang

        it only visits -> it only propagates

        Gerrit-Comment-Date: Tue, 03 Feb 2026 01:58:58 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        Comment-In-Reply-To: Yi Yang <qingf...@alibaba-inc.com>
        Comment-In-Reply-To: Jorropo <jorro...@gmail.com>
        unsatisfied_requirement
        open
        diffy

        Gerrit Bot (Gerrit)

        unread,
        Feb 3, 2026, 1:39:28 AMFeb 3
        to Yi Yang, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com
        Attention needed from Jorropo, Keith Randall and Martin Möhrmann

        Gerrit Bot uploaded new patchset

        Gerrit Bot uploaded patch set #3 to this change.
        Following approvals got outdated and were removed:
        • TryBots-Pass: LUCI-TryBot-Result-1 by Go LUCI
        Open in Gerrit

        Related details

        Attention is currently required from:
        • Jorropo
        • Keith Randall
        • Martin Möhrmann
        Submit Requirements:
        • requirement is not satisfiedCode-Review
        • requirement is not satisfiedNo-Unresolved-Comments
        • requirement is not satisfiedReview-Enforcement
        • requirement is not satisfiedTryBots-Pass
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: newpatchset
        Gerrit-Project: go
        Gerrit-Branch: master
        Gerrit-Change-Id: Iaf83f6ea355eed366c3d09fc38f85561634a5a16
        Gerrit-Change-Number: 740980
        Gerrit-PatchSet: 3
        unsatisfied_requirement
        open
        diffy

        Yi Yang (Gerrit)

        unread,
        Feb 11, 2026, 1:11:01 AMFeb 11
        to Gerrit Bot, goph...@pubsubhelper.golang.org, Go LUCI, Jorropo, Keith Randall, Martin Möhrmann, Gopher Robot, golang-co...@googlegroups.com
        Attention needed from Jorropo, Keith Randall and Martin Möhrmann

        Yi Yang added 1 comment

        Patchset-level comments
        File-level comment, Patchset 3 (Latest):
        Yi Yang . resolved

        The TryBot error seems unrelated to this patch. I suspect it was caused by my branch not being up-to-date with master. I have merged master now. Could a reviewer please help re-trigger the TryBot run?

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Jorropo
        • Keith Randall
        • Martin Möhrmann
        Submit Requirements:
        • requirement is not satisfiedCode-Review
        • requirement is not satisfiedNo-Unresolved-Comments
        • requirement is not satisfiedReview-Enforcement
        • requirement is not satisfiedTryBots-Pass
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: comment
        Gerrit-Project: go
        Gerrit-Branch: master
        Gerrit-Change-Id: Iaf83f6ea355eed366c3d09fc38f85561634a5a16
        Gerrit-Change-Number: 740980
        Gerrit-PatchSet: 3
        Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
        Gerrit-Reviewer: Jorropo <jorro...@gmail.com>
        Gerrit-Reviewer: Keith Randall <k...@golang.org>
        Gerrit-Reviewer: Martin Möhrmann <moeh...@google.com>
        Gerrit-CC: Gopher Robot <go...@golang.org>
        Gerrit-CC: Yi Yang <qingf...@alibaba-inc.com>
        Gerrit-Attention: Keith Randall <k...@golang.org>
        Gerrit-Attention: Jorropo <jorro...@gmail.com>
        Gerrit-Attention: Martin Möhrmann <moeh...@google.com>
        Gerrit-Comment-Date: Wed, 11 Feb 2026 06:10:58 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        unsatisfied_requirement
        open
        diffy

        Keith Randall (Gerrit)

        unread,
        Feb 11, 2026, 1:29:42 AMFeb 11
        to Yi Yang, Gerrit Bot, goph...@pubsubhelper.golang.org, Keith Randall, Go LUCI, Jorropo, Martin Möhrmann, Gopher Robot, golang-co...@googlegroups.com
        Attention needed from Jorropo and Martin Möhrmann

        Keith Randall voted Commit-Queue+1

        Commit-Queue+1
        Open in Gerrit

        Related details

        Attention is currently required from:
        • Jorropo
        • Martin Möhrmann
        Submit Requirements:
        • requirement is not satisfiedCode-Review
        • requirement is not satisfiedNo-Unresolved-Comments
        • requirement is not satisfiedReview-Enforcement
        • requirement is not satisfiedTryBots-Pass
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: comment
        Gerrit-Project: go
        Gerrit-Branch: master
        Gerrit-Change-Id: Iaf83f6ea355eed366c3d09fc38f85561634a5a16
        Gerrit-Change-Number: 740980
        Gerrit-PatchSet: 3
        Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
        Gerrit-Reviewer: Jorropo <jorro...@gmail.com>
        Gerrit-Reviewer: Keith Randall <k...@golang.org>
        Gerrit-Reviewer: Martin Möhrmann <moeh...@google.com>
        Gerrit-CC: Gopher Robot <go...@golang.org>
        Gerrit-CC: Yi Yang <qingf...@alibaba-inc.com>
        Gerrit-Attention: Jorropo <jorro...@gmail.com>
        Gerrit-Attention: Martin Möhrmann <moeh...@google.com>
        Gerrit-Comment-Date: Wed, 11 Feb 2026 06:29:38 +0000
        Gerrit-HasComments: No
        Gerrit-Has-Labels: Yes
        unsatisfied_requirement
        open
        diffy

        Yi Yang (Gerrit)

        unread,
        Feb 23, 2026, 9:09:41 PM (4 days ago) Feb 23
        to Gerrit Bot, goph...@pubsubhelper.golang.org, Go LUCI, Keith Randall, Jorropo, Martin Möhrmann, Gopher Robot, golang-co...@googlegroups.com
        Attention needed from Jorropo and Martin Möhrmann

        Yi Yang added 1 comment

        Patchset-level comments
        Yi Yang . resolved

        So what should I do next? Can the review be taken a step further? Thanks

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Jorropo
        • Martin Möhrmann
        Submit Requirements:
          • requirement is not satisfiedCode-Review
          • requirement is not satisfiedNo-Unresolved-Comments
          • requirement is not satisfiedReview-Enforcement
          • requirement satisfiedTryBots-Pass
          Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
          Gerrit-MessageType: comment
          Gerrit-Project: go
          Gerrit-Branch: master
          Gerrit-Change-Id: Iaf83f6ea355eed366c3d09fc38f85561634a5a16
          Gerrit-Change-Number: 740980
          Gerrit-PatchSet: 3
          Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
          Gerrit-Reviewer: Jorropo <jorro...@gmail.com>
          Gerrit-Reviewer: Keith Randall <k...@golang.org>
          Gerrit-Reviewer: Martin Möhrmann <moeh...@google.com>
          Gerrit-CC: Gopher Robot <go...@golang.org>
          Gerrit-CC: Yi Yang <qingf...@alibaba-inc.com>
          Gerrit-Attention: Jorropo <jorro...@gmail.com>
          Gerrit-Attention: Martin Möhrmann <moeh...@google.com>
          Gerrit-Comment-Date: Tue, 24 Feb 2026 02:09:37 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: No
          unsatisfied_requirement
          satisfied_requirement
          open
          diffy

          Keith Randall (Gerrit)

          unread,
          Feb 23, 2026, 10:14:38 PM (4 days ago) Feb 23
          to Yi Yang, Gerrit Bot, goph...@pubsubhelper.golang.org, Go LUCI, Keith Randall, Jorropo, Martin Möhrmann, Gopher Robot, golang-co...@googlegroups.com
          Attention needed from Jorropo, Martin Möhrmann and Yi Yang

          Keith Randall added 1 comment

          Patchset-level comments
          Yi Yang . resolved

          So what should I do next? Can the review be taken a step further? Thanks

          Keith Randall

          Sorry, generally we only revisit CLs once all comments have been resolved.
          You should act on any comments from reviewers so far (do what they ask, or explain why it isn't a good idea, or whatever) and mark those comments as resolved.

          Open in Gerrit

          Related details

          Attention is currently required from:
          • Jorropo
          • Martin Möhrmann
          • Yi Yang
          Submit Requirements:
          • requirement is not satisfiedCode-Review
          • requirement is not satisfiedNo-Unresolved-Comments
          • requirement is not satisfiedReview-Enforcement
          • requirement satisfiedTryBots-Pass
          Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
          Gerrit-MessageType: comment
          Gerrit-Project: go
          Gerrit-Branch: master
          Gerrit-Change-Id: Iaf83f6ea355eed366c3d09fc38f85561634a5a16
          Gerrit-Change-Number: 740980
          Gerrit-PatchSet: 3
          Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
          Gerrit-Reviewer: Jorropo <jorro...@gmail.com>
          Gerrit-Reviewer: Keith Randall <k...@golang.org>
          Gerrit-Reviewer: Martin Möhrmann <moeh...@google.com>
          Gerrit-CC: Gopher Robot <go...@golang.org>
          Gerrit-CC: Yi Yang <qingf...@alibaba-inc.com>
          Gerrit-Attention: Yi Yang <qingf...@alibaba-inc.com>
          Gerrit-Attention: Jorropo <jorro...@gmail.com>
          Gerrit-Attention: Martin Möhrmann <moeh...@google.com>
          Gerrit-Comment-Date: Tue, 24 Feb 2026 03:14:33 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: No
          Comment-In-Reply-To: Yi Yang <qingf...@alibaba-inc.com>
          unsatisfied_requirement
          satisfied_requirement
          open
          diffy

          Yi Yang (Gerrit)

          unread,
          Feb 23, 2026, 10:41:02 PM (4 days ago) Feb 23
          to Gerrit Bot, goph...@pubsubhelper.golang.org, Go LUCI, Keith Randall, Jorropo, Martin Möhrmann, Gopher Robot, golang-co...@googlegroups.com
          Attention needed from Jorropo and Martin Möhrmann

          Yi Yang added 2 comments

          Patchset-level comments
          Yi Yang . resolved

          Thanks for the detailed explanation, @Keith, I get it now.

          I think I've addressed all the comments. @Jorropo, please let me know if you have any other concerns.

          I've marked the threads as resolved to keep things moving.

          File src/cmd/compile/internal/ssa/sccp.go
          Line 57, Patchset 2: inUses *sparseSet // IDs already in uses, for duplicate check
          Jorropo . resolved

          It looks to me like you want to use a bitset instead.

          Since SCCP visits most values in the function and you want to store one bit per value.
          (value IDs are dense)

          Yi Yang

          SCCP is sparse, it only visits a small number of values, not most of them.

          Do you mean I should use a `uses []*Value` slice indexed by val.ID, instead of the inUses+uses combination?

          Yi Yang

          it only visits -> it only propagates

          Yi Yang

          Done

          Open in Gerrit

          Related details

          Attention is currently required from:
          • Jorropo
          • Martin Möhrmann
          Submit Requirements:
            • requirement is not satisfiedCode-Review
            • requirement satisfiedNo-Unresolved-Comments
            • requirement is not satisfiedReview-Enforcement
            • requirement satisfiedTryBots-Pass
            Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
            Gerrit-MessageType: comment
            Gerrit-Project: go
            Gerrit-Branch: master
            Gerrit-Change-Id: Iaf83f6ea355eed366c3d09fc38f85561634a5a16
            Gerrit-Change-Number: 740980
            Gerrit-PatchSet: 3
            Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
            Gerrit-Reviewer: Jorropo <jorro...@gmail.com>
            Gerrit-Reviewer: Keith Randall <k...@golang.org>
            Gerrit-Reviewer: Martin Möhrmann <moeh...@google.com>
            Gerrit-CC: Gopher Robot <go...@golang.org>
            Gerrit-CC: Yi Yang <qingf...@alibaba-inc.com>
            Gerrit-Attention: Jorropo <jorro...@gmail.com>
            Gerrit-Attention: Martin Möhrmann <moeh...@google.com>
            Gerrit-Comment-Date: Tue, 24 Feb 2026 03:40:58 +0000
            Gerrit-HasComments: Yes
            Gerrit-Has-Labels: No
            Comment-In-Reply-To: Yi Yang <qingf...@alibaba-inc.com>
            Comment-In-Reply-To: Jorropo <jorro...@gmail.com>
            unsatisfied_requirement
            satisfied_requirement
            open
            diffy

            Keith Randall (Gerrit)

            unread,
            1:10 PM (2 hours ago) 1:10 PM
            to Yi Yang, Gerrit Bot, goph...@pubsubhelper.golang.org, Keith Randall, Go LUCI, Jorropo, Martin Möhrmann, Gopher Robot, golang-co...@googlegroups.com
            Attention needed from Jorropo and Martin Möhrmann

            Keith Randall voted and added 1 comment

            Votes added by Keith Randall

            Code-Review+2

            1 comment

            File src/cmd/compile/internal/ssa/sccp.go
            Line 278, Patchset 3 (Latest): if val == use {
            Keith Randall . unresolved

            This seems like it would be better fixed by just not putting the use in the defUse map in the first place.

            Open in Gerrit

            Related details

            Attention is currently required from:
            • Jorropo
            • Martin Möhrmann
            Submit Requirements:
            • requirement satisfiedCode-Review
            • requirement is not satisfiedNo-Unresolved-Comments
            • requirement is not satisfiedReview-Enforcement
            • requirement satisfiedTryBots-Pass
            Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
            Gerrit-MessageType: comment
            Gerrit-Project: go
            Gerrit-Branch: master
            Gerrit-Change-Id: Iaf83f6ea355eed366c3d09fc38f85561634a5a16
            Gerrit-Change-Number: 740980
            Gerrit-PatchSet: 3
            Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
            Gerrit-Reviewer: Jorropo <jorro...@gmail.com>
            Gerrit-Reviewer: Keith Randall <k...@golang.org>
            Gerrit-Reviewer: Martin Möhrmann <moeh...@google.com>
            Gerrit-CC: Gopher Robot <go...@golang.org>
            Gerrit-CC: Yi Yang <qingf...@alibaba-inc.com>
            Gerrit-Attention: Jorropo <jorro...@gmail.com>
            Gerrit-Attention: Martin Möhrmann <moeh...@google.com>
            Gerrit-Comment-Date: Fri, 27 Feb 2026 18:09:58 +0000
            Gerrit-HasComments: Yes
            Gerrit-Has-Labels: Yes
            satisfied_requirement
            unsatisfied_requirement
            open
            diffy

            Keith Randall (Gerrit)

            unread,
            1:10 PM (2 hours ago) 1:10 PM
            to Yi Yang, Gerrit Bot, goph...@pubsubhelper.golang.org, Keith Randall, Go LUCI, Jorropo, Martin Möhrmann, Gopher Robot, golang-co...@googlegroups.com
            Attention needed from Jorropo and Martin Möhrmann

            Keith Randall voted Code-Review+1

            Code-Review+1
            Open in Gerrit

            Related details

            Attention is currently required from:
            • Jorropo
            • Martin Möhrmann
            Submit Requirements:
            • requirement satisfiedCode-Review
            • requirement is not satisfiedNo-Unresolved-Comments
            • requirement is not satisfiedReview-Enforcement
            • requirement satisfiedTryBots-Pass
            Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
            Gerrit-MessageType: comment
            Gerrit-Project: go
            Gerrit-Branch: master
            Gerrit-Change-Id: Iaf83f6ea355eed366c3d09fc38f85561634a5a16
            Gerrit-Change-Number: 740980
            Gerrit-PatchSet: 3
            Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
            Gerrit-Reviewer: Jorropo <jorro...@gmail.com>
            Gerrit-Reviewer: Keith Randall <k...@golang.org>
            Gerrit-Reviewer: Keith Randall <k...@google.com>
            Gerrit-Reviewer: Martin Möhrmann <moeh...@google.com>
            Gerrit-CC: Gopher Robot <go...@golang.org>
            Gerrit-CC: Yi Yang <qingf...@alibaba-inc.com>
            Gerrit-Attention: Jorropo <jorro...@gmail.com>
            Gerrit-Attention: Martin Möhrmann <moeh...@google.com>
            Gerrit-Comment-Date: Fri, 27 Feb 2026 18:10:30 +0000
            Gerrit-HasComments: No
            Gerrit-Has-Labels: Yes
            satisfied_requirement
            unsatisfied_requirement
            open
            diffy
            Reply all
            Reply to author
            Forward
            0 new messages