Merge pull request #31585 from compnerd/likely

runtime: replace `LLVM_LIKELY` with `SWIFT_LIKELY` (NFC)
This commit is contained in:
Saleem Abdulrasool
2020-05-07 09:21:58 -07:00
committed by GitHub
2 changed files with 13 additions and 9 deletions

View File

@@ -4682,8 +4682,9 @@ swift_getAssociatedTypeWitnessSlowImpl(
#endif
// If the low bit of the witness is clear, it's already a metadata pointer.
if (LLVM_LIKELY((uintptr_t(witness) &
ProtocolRequirementFlags::AssociatedTypeMangledNameBit) == 0)) {
if (SWIFT_LIKELY((reinterpret_cast<uintptr_t>(witness) &
ProtocolRequirementFlags::AssociatedTypeMangledNameBit) ==
0)) {
// Cached metadata pointers are always complete.
return MetadataResponse{(const Metadata *)witness, MetadataState::Complete};
}
@@ -4803,8 +4804,9 @@ swift::swift_getAssociatedTypeWitness(MetadataRequest request,
extraDiscriminator));
#endif
if (LLVM_LIKELY((uintptr_t(witness) &
ProtocolRequirementFlags::AssociatedTypeMangledNameBit) == 0)) {
if (SWIFT_LIKELY((reinterpret_cast<uintptr_t>(witness) &
ProtocolRequirementFlags::AssociatedTypeMangledNameBit) ==
0)) {
// Cached metadata pointers are always complete.
return MetadataResponse{(const Metadata *)witness, MetadataState::Complete};
}
@@ -4855,8 +4857,9 @@ static const WitnessTable *swift_getAssociatedConformanceWitnessSlowImpl(
#endif
// Fast path: we've already resolved this to a witness table, so return it.
if (LLVM_LIKELY((uintptr_t(witness) &
ProtocolRequirementFlags::AssociatedTypeMangledNameBit) == 0)) {
if (SWIFT_LIKELY((reinterpret_cast<uintptr_t>(witness) &
ProtocolRequirementFlags::AssociatedTypeMangledNameBit) ==
0)) {
return static_cast<const WitnessTable *>(witness);
}
@@ -4931,8 +4934,9 @@ const WitnessTable *swift::swift_getAssociatedConformanceWitness(
#endif
// Fast path: we've already resolved this to a witness table, so return it.
if (LLVM_LIKELY((uintptr_t(witness) &
ProtocolRequirementFlags::AssociatedTypeMangledNameBit) == 0)) {
if (SWIFT_LIKELY((reinterpret_cast<uintptr_t>(witness) &
ProtocolRequirementFlags::AssociatedTypeMangledNameBit) ==
0)) {
return static_cast<const WitnessTable *>(witness);
}