@@ -10993,7 +10993,8 @@ class TryApplyInstBase : public TermInst {
10993
10993
10994
10994
protected:
10995
10995
TryApplyInstBase (SILInstructionKind valueKind, SILDebugLocation Loc,
10996
- SILBasicBlock *normalBB, SILBasicBlock *errorBB);
10996
+ SILBasicBlock *normalBB, SILBasicBlock *errorBB,
10997
+ ProfileCounter normalCount, ProfileCounter errorCount);
10997
10998
10998
10999
public:
10999
11000
SuccessorListTy getSuccessors () {
@@ -11013,6 +11014,11 @@ class TryApplyInstBase : public TermInst {
11013
11014
const SILBasicBlock *getNormalBB () const { return DestBBs[NormalIdx]; }
11014
11015
SILBasicBlock *getErrorBB () { return DestBBs[ErrorIdx]; }
11015
11016
const SILBasicBlock *getErrorBB () const { return DestBBs[ErrorIdx]; }
11017
+
11018
+ // / The number of times the Normal branch was executed
11019
+ ProfileCounter getNormalBBCount () const { return DestBBs[NormalIdx].getCount (); }
11020
+ // / The number of times the Error branch was executed
11021
+ ProfileCounter getErrorBBCount () const { return DestBBs[ErrorIdx].getCount (); }
11016
11022
};
11017
11023
11018
11024
// / TryApplyInst - Represents the full application of a function that
@@ -11030,15 +11036,19 @@ class TryApplyInst final
11030
11036
SILBasicBlock *normalBB, SILBasicBlock *errorBB,
11031
11037
ApplyOptions options,
11032
11038
const GenericSpecializationInformation *specializationInfo,
11033
- std::optional<ApplyIsolationCrossing> isolationCrossing);
11039
+ std::optional<ApplyIsolationCrossing> isolationCrossing,
11040
+ ProfileCounter normalCount,
11041
+ ProfileCounter errorCount);
11034
11042
11035
11043
static TryApplyInst *
11036
11044
create (SILDebugLocation debugLoc, SILValue callee,
11037
11045
SubstitutionMap substitutions, ArrayRef<SILValue> args,
11038
11046
SILBasicBlock *normalBB, SILBasicBlock *errorBB, ApplyOptions options,
11039
11047
SILFunction &parentFunction,
11040
11048
const GenericSpecializationInformation *specializationInfo,
11041
- std::optional<ApplyIsolationCrossing> isolationCrossing);
11049
+ std::optional<ApplyIsolationCrossing> isolationCrossing,
11050
+ ProfileCounter normalCount,
11051
+ ProfileCounter errorCount);
11042
11052
};
11043
11053
11044
11054
// / DifferentiableFunctionInst - creates a `@differentiable` function-typed
0 commit comments