[PATCH] D157103: AMDGPU: Fix counting source modifiers as literal constants

Jay Foad via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 11 03:27:35 PDT 2023


foad added a comment.

> 4b1702e87a2687569b197aea4721353f8b788182 <https://reviews.llvm.org/rG4b1702e87a2687569b197aea4721353f8b788182>

This is causing:

  $ cat r.ll
  define amdgpu_ps half @f(half %arg) {
  bb:
    %i = fmul contract half %arg, 0xH3A66
    %i1 = fadd contract half %i, 0xH2E66
    %i2 = fmul contract half %arg, 0xH0000
    %i3 = fsub contract half 0xH3A66, %i2
    %i4 = call half @llvm.amdgcn.fmed3.f16(half %i1, half %i3, half 0xH0000)
    ret half %i4
  }
  declare half @llvm.amdgcn.fmed3.f16(half, half, half)
  $ llc -march=amdgcn -mcpu=gfx1010 -o /dev/null r.ll 
  error: Illegal instruction detected: VOP2/VOP3 instruction uses more than one literal
  renamable $vgpr1 = contract nofpexcept V_FMAAK_F16 14950, $vgpr0, 11878, implicit $mode, implicit $exec

Can you please fix or revert?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D157103/new/

https://reviews.llvm.org/D157103



More information about the llvm-commits mailing list