llvm/llvm-project
[DAG] isKnownToBeAPowerOfTwo - add DemandedElts + OrZero handling to ISD::ZERO_EXTEND cases
已关闭
#181,648 创建于 2026年2月16日
good first issuellvm:SelectionDAG
仓库指标
- 星标
- (26,378 个星标)
- PR 合并指标
- (平均合并 1天 2小时) (30 天内合并 1,000 个 PR)
描述
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