[AMDGPU] Improve selection of pseudo-scalar transcendental instructions
Open
backend:AMDGPU
missed-optimization
- Dominant language
- LLVM
- Stars
- 40.5k
- Forks
- 18.7k
- PR merge metrics
- PR metrics pending
Description
`test/CodeGen/AMDGPU/pseudo-scalar-transcendental.ll` shows various cases where we are selecting VALU trans instructions (`v_exp`, `v_sqrt` etc) instead of the pseudo-scalar versions (`v_s_exp`, `v_s_sqrt` etc). These cases should be fixed one by one.
Currently I see these issues:
- In `@v_s_log_f32` and some other functions, gisel selects `v_ldexp` and `v_log`. There is no `v_s_ldexp` but we can use `s_mul` instead of `v_ldexp` like sdag does.
- In `@fdiv_f32_i32`, sdag selects `v_rcp_iflag_f32`.
- In `@fdiv_f16_i16`, both sdag and gisel select `v_rcp_f16`.
Some of these issues might be good for beginners.
Contributor guide
Assessment
This issue has not been assessed yet.