[Clang][ConstExpr] Allow __builtin_elementwise_sqrt + __builtin_sqrt/sqrtf/sqrtl to be used in constant expressions
- Dominant language
- LLVM
- Stars
- 40.5k
- Forks
- 18.7k
- PR merge metrics
- PR metrics pending
Description
There's quite a bit of work to do before we can handle this, including some of the libc support - its not as easy as hooking up to a APFloat::sqrt method.
This also might need splitting as we lower the elementwise to ` @llvm.sqrt.XXXX` but the scalar builtins typically to libcalls
Contributor guide
Research direction
No files or tests are named. Start by tracing Clang constant-expression handling for __builtin_elementwise_sqrt and the scalar sqrt builtins, then examine the APFloat::sqrt and libc support mentioned in the issue. Check how elementwise calls lower to @llvm.sqrt while scalar builtins lower to libcalls; done requires constant-expression support for the requested builtins.
Written by the indexing model from the issue text.
Assessment
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100