Mark CRC32C Extend and ExtendAndCopy overrides with ABSL_ATTRIBUTE_HOT `CRC32AcceleratedX86ARMCombinedMultipleStreams` instantiates multiple CPU-specific subclasses in the same binary and selects one at runtime. Under sample-based profile-guided optimization (AutoFDO), subclasses not exercised on the profiled CPU have zero samples, and inlining `hot` template helpers into the unannotated `Extend` and `ExtendAndCopy` virtual overrides drops `Attribute::Hot` (`IntersectAnd`), placing those overrides in `.text.unlikely`. Annotate the virtual `Extend` and `ExtendAndCopy` overrides directly with `ABSL_ATTRIBUTE_HOT` so all hardware-accelerated specializations remain in `.text.hot` regardless of which CPU was profiled. PiperOrigin-RevId: 1020725737
diff --git a/absl/crc/internal/crc_x86_arm_combined.cc b/absl/crc/internal/crc_x86_arm_combined.cc index 6f16154..3889427 100644 --- a/absl/crc/internal/crc_x86_arm_combined.cc +++ b/absl/crc/internal/crc_x86_arm_combined.cc
@@ -530,14 +530,15 @@ class CRC32AcceleratedX86ARMCombinedMultipleStreams : public CRC32AcceleratedX86ARMCombinedMultipleStreamsBase { public: - void Extend(uint32_t* crc, const void* bytes, - const size_t length) const override { + ABSL_ATTRIBUTE_HOT void Extend(uint32_t* crc, const void* bytes, + const size_t length) const override { Extend<CopyType::kNone>(crc, bytes, length); } - void ExtendAndCopy(uint32_t* crc, void* __restrict dst, - const void* __restrict src, size_t length, - bool non_temporal) const override { + ABSL_ATTRIBUTE_HOT void ExtendAndCopy(uint32_t* crc, void* __restrict dst, + const void* __restrict src, + size_t length, + bool non_temporal) const override { if (non_temporal) { Extend<CopyType::kNonTemporal>(crc, src, length, dst); } else {