Skip to content

Compute v_madmk with all constant operands at compile time #68315

Closed
@kosarev

Description

@kosarev

The output for the llvm/test/CodeGen/AMDGPU/amdgpu-codegenprepare-idiv.ll test currently reads like we fail to fold the v_madmk_f32 instruction despite all operands being constant. See a related discussion in https://reviews.llvm.org/D74435#inline-1549598.

define amdgpu_kernel void @udiv_i64_oddk_denom(ptr addrspace(1) %out, i64 %x) {
...
; GFX9-LABEL: udiv_i64_oddk_denom:
; GFX9:       ; %bb.0:
; GFX9-NEXT:    v_mov_b32_e32 v0, 0x4f176a73
; GFX9-NEXT:    v_mov_b32_e32 v1, 0x4f800000
; GFX9-NEXT:    v_madmk_f32 v0, v1, 0x438f8000, v0

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions