[ValueTracking] computeKnownBitsFromOperator - should we move target intrinsic handling into target hooks?
- Dominant language
- LLVM
- Stars
- 40.5k
- Forks
- 18.7k
- PR merge metrics
- PR metrics pending
Description
computeKnownBitsFromOperator currently handles a number of x86/riscv intrinsics and I'm intending to add handling for more x86 intrinsics in the coming months.
Before this work begins, should we instead move to a TTI hook, similar to what we do with X86TTIImpl::simplifyDemandedUseBitsIntrinsic etc?
At the moment x86 intrinsic constant folding is spread out across computeKnownBitsFromOperator / simplifyDemandedUseBitsIntrinsic / instCombineIntrinsic :(
CC @nikic @dtcxzyw
Contributor guide
Research direction
Start by reading computeKnownBitsFromOperator and compare its intrinsic handling with X86TTIImpl::simplifyDemandedUseBitsIntrinsic and instCombineIntrinsic. Trace how the existing x86 and RISC-V cases are distributed, then determine whether a TTI hook is an appropriate home; done requires an agreed design before implementation begins.
Written by the indexing model from the issue text.
Assessment
- Domain
- compilers
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100