llvm / llvm/llvm-project

[AMDGPU] Improve selection of pseudo-scalar transcendental instructions

Open
#189,936 2 comments 0 reactions 0 assignees View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.