-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
introduce @branchHint builtin #21148
Copy link
Copy link
Closed
Labels
acceptedThis proposal is planned.This proposal is planned.breakingImplementing this issue could cause existing code to no longer compile or have different behavior.Implementing this issue could cause existing code to no longer compile or have different behavior.proposalThis issue suggests language modifications. If it also has the "accepted" label then it is planned.This issue suggests language modifications. If it also has the "accepted" label then it is planned.
Milestone
Metadata
Metadata
Assignees
Labels
acceptedThis proposal is planned.This proposal is planned.breakingImplementing this issue could cause existing code to no longer compile or have different behavior.Implementing this issue could cause existing code to no longer compile or have different behavior.proposalThis issue suggests language modifications. If it also has the "accepted" label then it is planned.This issue suggests language modifications. If it also has the "accepted" label then it is planned.
Type
Fields
Give feedbackNo fields configured for issues without a type.
This proposal supplants:
@setColdwith@cold#5177@branchWeightbuiltin with numerical branch weights #20642reachablekeyword for branch hints #21058Basic example syntax:
Some rules:
@branchHintoperand is a comptime expression.@panic(including from safety check) implicitly are "cold".@branchHintcalls in the same block is a compile error.@branchHintis not the first statement in a block.Furthermore:
@coldor@setColdbuiltin. (replaced by@branchHint(.cold);at the beginning of the function.unlikelyand can be overridden.Issue close criteria:
@setColdbuiltin