llvm/llvm-project
[DAG] isKnownToBeAPowerOfTwo - add DemandedElts + OrZero handling to ISD::ZERO_EXTEND cases
Fermée
#181 648 ouverte le 16 févr. 2026
good first issuellvm:SelectionDAG
Métriques du dépôt
- Stars
- (26 378 étoiles)
- Métriques de merge PR
- (Merge moyen 1j 2h) (1 000 PRs mergées en 30 j)
Description
The zext nodes can safely filter elements using DemandedElts and can correctly identify zero cases when OrZero is true (zext(0) is still 0):
The actual change to the inner isKnownToBeAPowerOfTwo call is trivial (add DemandedElts + OrZero passthrough args), but this will require test coverage as well - these might be possible by extending existing DAG tests, else maybe add unit tests like we did in https://github.com/llvm/llvm-project/pull/181485