@@ -384,13 +384,15 @@ def WeightedBranchOpInterface : OpInterface<"WeightedBranchOpInterface"> {
384
384
This interface provides weight information for branching terminator
385
385
operations, i.e. terminator operations with successors.
386
386
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
392
391
must match the number of successors of the operation.
393
392
393
+ Note that the branch weight use an i32 representation but they are to be
394
+ interpreted as unsigned integers.
395
+
394
396
The default implementations of the methods expect the operation
395
397
to have an attribute of type DenseI32ArrayAttr named branch_weights.
396
398
}];
@@ -440,19 +442,21 @@ def WeightedRegionBranchOpInterface
440
442
This interface provides weight information for region operations
441
443
that exhibit branching behavior between held regions.
442
444
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).
450
451
451
452
The weights specify the probability of branching to a particular
452
453
region when first executing the operation.
453
454
For example, for loop-like operations with a single region
454
455
the weight specifies the probability of entering the loop.
455
456
457
+ Note that the branch weight use an i32 representation but they are to be
458
+ interpreted as unsigned integers.
459
+
456
460
The default implementations of the methods expect the operation
457
461
to have an attribute of type DenseI32ArrayAttr named branch_weights.
458
462
}];
0 commit comments