@@ -677,18 +677,18 @@ class CallsiteContextGraph {
677
677
678
678
// / Computes the alloc type corresponding to the given context ids, by
679
679
// / unioning their recorded alloc types.
680
- uint8_t computeAllocType (DenseSet<uint32_t > &ContextIds);
680
+ uint8_t computeAllocType (DenseSet<uint32_t > &ContextIds) const ;
681
681
682
682
// / Returns the allocation type of the intersection of the contexts of two
683
683
// / nodes (based on their provided context id sets), optimized for the case
684
684
// / when Node1Ids is smaller than Node2Ids.
685
685
uint8_t intersectAllocTypesImpl (const DenseSet<uint32_t > &Node1Ids,
686
- const DenseSet<uint32_t > &Node2Ids);
686
+ const DenseSet<uint32_t > &Node2Ids) const ;
687
687
688
688
// / Returns the allocation type of the intersection of the contexts of two
689
689
// / nodes (based on their provided context id sets).
690
690
uint8_t intersectAllocTypes (const DenseSet<uint32_t > &Node1Ids,
691
- const DenseSet<uint32_t > &Node2Ids);
691
+ const DenseSet<uint32_t > &Node2Ids) const ;
692
692
693
693
// / Create a clone of Edge's callee and move Edge to that new callee node,
694
694
// / performing the necessary context id and allocation type updates.
@@ -1152,12 +1152,12 @@ void CallsiteContextGraph<DerivedCCG, FuncTy, CallTy>::ContextNode::
1152
1152
1153
1153
template <typename DerivedCCG, typename FuncTy, typename CallTy>
1154
1154
uint8_t CallsiteContextGraph<DerivedCCG, FuncTy, CallTy>::computeAllocType(
1155
- DenseSet<uint32_t > &ContextIds) {
1155
+ DenseSet<uint32_t > &ContextIds) const {
1156
1156
uint8_t BothTypes =
1157
1157
(uint8_t )AllocationType::Cold | (uint8_t )AllocationType::NotCold;
1158
1158
uint8_t AllocType = (uint8_t )AllocationType::None;
1159
1159
for (auto Id : ContextIds) {
1160
- AllocType |= (uint8_t )ContextIdToAllocationType[Id] ;
1160
+ AllocType |= (uint8_t )ContextIdToAllocationType. at (Id) ;
1161
1161
// Bail early if alloc type reached both, no further refinement.
1162
1162
if (AllocType == BothTypes)
1163
1163
return AllocType;
@@ -1168,14 +1168,15 @@ uint8_t CallsiteContextGraph<DerivedCCG, FuncTy, CallTy>::computeAllocType(
1168
1168
template <typename DerivedCCG, typename FuncTy, typename CallTy>
1169
1169
uint8_t
1170
1170
CallsiteContextGraph<DerivedCCG, FuncTy, CallTy>::intersectAllocTypesImpl(
1171
- const DenseSet<uint32_t > &Node1Ids, const DenseSet<uint32_t > &Node2Ids) {
1171
+ const DenseSet<uint32_t > &Node1Ids,
1172
+ const DenseSet<uint32_t > &Node2Ids) const {
1172
1173
uint8_t BothTypes =
1173
1174
(uint8_t )AllocationType::Cold | (uint8_t )AllocationType::NotCold;
1174
1175
uint8_t AllocType = (uint8_t )AllocationType::None;
1175
1176
for (auto Id : Node1Ids) {
1176
1177
if (!Node2Ids.count (Id))
1177
1178
continue ;
1178
- AllocType |= (uint8_t )ContextIdToAllocationType[Id] ;
1179
+ AllocType |= (uint8_t )ContextIdToAllocationType. at (Id) ;
1179
1180
// Bail early if alloc type reached both, no further refinement.
1180
1181
if (AllocType == BothTypes)
1181
1182
return AllocType;
@@ -1185,7 +1186,8 @@ CallsiteContextGraph<DerivedCCG, FuncTy, CallTy>::intersectAllocTypesImpl(
1185
1186
1186
1187
template <typename DerivedCCG, typename FuncTy, typename CallTy>
1187
1188
uint8_t CallsiteContextGraph<DerivedCCG, FuncTy, CallTy>::intersectAllocTypes(
1188
- const DenseSet<uint32_t > &Node1Ids, const DenseSet<uint32_t > &Node2Ids) {
1189
+ const DenseSet<uint32_t > &Node1Ids,
1190
+ const DenseSet<uint32_t > &Node2Ids) const {
1189
1191
if (Node1Ids.size () < Node2Ids.size ())
1190
1192
return intersectAllocTypesImpl (Node1Ids, Node2Ids);
1191
1193
else
0 commit comments