[DAG] ISD::matchUnaryPredicate / matchUnaryFpPredicate / matchBinaryPredicate - add DemandedElts variant
#181.658 geöffnet am 16. Feb. 2026
Repository-Metriken
- Stars
- (26.378 Stars)
- PR-Merge-Metriken
- (Durchschn. Merge 1T 2h) (1.000 gemergte PRs in 30 T)
Beschreibung
The ISD::match*Predicate methods help us to perform all_of tests on scalar/splat/build_vector constants with a callback test.
It'd be very useful if we could provide variants of these that take a DemandedElts argument (similar to #181485 and other DAG value tracking methods), to allow us to restrict the build_vector tests to specific elements.
For instance, this would allow us to remove the vector constant checks from isKnownToBeAPowerOfTwo entirely and just use the initial matchUnaryPredicate call at the start of the method:
scalar/splat cases can just ignore the DemandedElts argument, but we should assert the build_vector are the same size as the DemandedElts APInt