mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
ValueEnumerator: make the index type unsigned instead of size_t
This reduces the size of the index from 8 to 4 bytes, which is important in AliasAnalysis where we use pairs of such indices.
This commit is contained in:
@@ -546,11 +546,11 @@ AliasAnalysis::computeMemoryBehaviorInner(SILInstruction *Inst, SILValue V) {
|
||||
|
||||
MemBehaviorKeyTy AliasAnalysis::toMemoryBehaviorKey(SILInstruction *V1,
|
||||
SILValue V2) {
|
||||
size_t idx1 = InstructionToIndex.getIndex(V1);
|
||||
assert(idx1 != std::numeric_limits<size_t>::max() &&
|
||||
ValueIndexTy idx1 = InstructionToIndex.getIndex(V1);
|
||||
assert(idx1 != std::numeric_limits<ValueIndexTy>::max() &&
|
||||
"~0 index reserved for empty/tombstone keys");
|
||||
size_t idx2 = ValueToIndex.getIndex(V2);
|
||||
assert(idx2 != std::numeric_limits<size_t>::max() &&
|
||||
ValueIndexTy idx2 = ValueToIndex.getIndex(V2);
|
||||
assert(idx2 != std::numeric_limits<ValueIndexTy>::max() &&
|
||||
"~0 index reserved for empty/tombstone keys");
|
||||
return {idx1, idx2};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user