Skip to content

cmd/compile: teach prove about min #30584

@josharian

Description

@josharian
package p

func f(x, y []int) {
	n := len(x)
	if len(y) < n {
		n = len(y)
	}
	for i := 0; i < n; i++ {
		_ = x[i]
		_ = y[i]
	}
}

Ideally there would be no bounds checks in the loop. Right now there are.

This grew out of a conversation in CL 164966.

cc @rasky @aclements @zdjones

Metadata

Metadata

Assignees

No one assigned

    Labels

    NeedsFixThe path to resolution is known, but the work has not been done.Performancecompiler/runtimeIssues related to the Go compiler and/or runtime.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions