[libcu++] Reduce tuple and pair constraint instantiations - #10858
[libcu++] Reduce tuple and pair constraint instantiations#10858abdeltaehass wants to merge 1 commit into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (3)
💤 Files with no reviewable changes (1)
Included review availability: Your plan includes up to 12 reviews per rolling hour; 11 remain after this review. 📝 WalkthroughSummary by CodeRabbit
WalkthroughChangesThe PR replaces eagerly instantiated tuple and pair constructor constraint aliases and variable templates with immediate selector functions. It updates variadic, tuple-like, allocator-aware, forwarding, converting, explicit, implicit, and deleted constructors. Suggested reviewers: ChangesTuple and pair constructor constraints
Assessment against linked issues
Suggested reviewers: Merge Risk: ⚪ Minimal · up to This PR reduces compile-time constraint-instantiation overhead while preserving constructor behavior and overload participation; no actionable merge-blocking risk remains beyond normal checks and review. Comment |
|
Closing per #10846 (comment) |
| // Old MSVC chokes about a static constexpr variable needing an initializer. Work around by using a type | ||
| template <class... _UTypes> |
There was a problem hiding this comment.
There was a fence here for a reason.
The problem is that old MSVC needs to go through an explicit type instantiation in this case. So this would not have compiled with older MSVC
Summary
static constevalhelpersintegral_constantconstructor aliasesnoexceptexpressions unchangedCloses #10846.
This is a deliberately smaller alternative to #10719. That PR is broader and centralizes tuple/pair construction, assignment, and comparison constraints; this PR only removes the measured constructor-selector variable-template layer.
Compile-time measurements
Measured with Apple Clang 21.0.0 using the same generated source, SDK, standard library, flags, and alternating run order against an unchanged
upstream/mainworktree.A C++20 Clang trace with 128 unique cases showed the four targeted inline-variable initializers falling from 4,096 evaluations to zero. Total
EvaluateAsInitializerevents fell from 32,780 to 28,681.The smaller C++20 128-case wall-time series was neutral by mean (4.377 s to 4.375 s), so no improvement is claimed for that series.
Validation
pre-commitpassed for all three modified headersgit diff --checkpassedNot run locally: the official CMake/lit suite, NVCC/device tests, GCC, MSVC, or GPU tests because those toolchains were unavailable.