@@ -384,13 +384,15 @@ def WeightedBranchOpInterface : OpInterface<"WeightedBranchOpInterface"> {
384384 This interface provides weight information for branching terminator
385385 operations, i.e. terminator operations with successors.
386386
387- This interface provides methods for getting/setting integer non-negative
388- weight of each branch. The probability of executing a branch
389- is computed as the ratio between the branch's weight and the total
390- sum of the weights (which cannot be zero).
391- The weights are optional. If they are provided, then their number
387+ This interface provides methods for getting/setting integer weights of each
388+ branch. The probability of executing a branch is computed as the ratio
389+ between the branch's weight and the total sum of the weights (which cannot
390+ be zero). The weights are optional. If they are provided, then their number
392391 must match the number of successors of the operation.
393392
393+ Note that the branch weight use an i32 representation but they are to be
394+ interpreted as unsigned integers.
395+
394396 The default implementations of the methods expect the operation
395397 to have an attribute of type DenseI32ArrayAttr named branch_weights.
396398 }];
@@ -440,19 +442,21 @@ def WeightedRegionBranchOpInterface
440442 This interface provides weight information for region operations
441443 that exhibit branching behavior between held regions.
442444
443- This interface provides methods for getting/setting integer non-negative
444- weight of each branch. The probability of executing a region is computed
445- as the ratio between the region branch's weight and the total sum
446- of the weights (which cannot be zero).
447- The weights are optional. If they are provided, then their number
448- must match the number of regions held by the operation
449- (including empty regions).
445+ This interface provides methods for getting/setting integer weights of each
446+ branch. The probability of executing a region is computed as the ratio
447+ between the region branch's weight and the total sum of the weights (which
448+ cannot be zero). The weights are optional. If they are provided, then their
449+ number must match the number of regions held by the operation (including
450+ empty regions).
450451
451452 The weights specify the probability of branching to a particular
452453 region when first executing the operation.
453454 For example, for loop-like operations with a single region
454455 the weight specifies the probability of entering the loop.
455456
457+ Note that the branch weight use an i32 representation but they are to be
458+ interpreted as unsigned integers.
459+
456460 The default implementations of the methods expect the operation
457461 to have an attribute of type DenseI32ArrayAttr named branch_weights.
458462 }];
0 commit comments