[all-commits] [llvm/llvm-project] 86edf9: [AMDGPU][GlobalISel] Fold neg/abs modifiers when m...

Domenic Nutile via All-commits all-commits at lists.llvm.org
Mon Sep 14 14:31:49 PDT 2026


  Branch: refs/heads/users/saxlungs/fma-mix-lo-neg-fold
  Home:   https://github.com/llvm/llvm-project
  Commit: 86edf90eb9ddb934f6c68184913cb970281b35a9
      https://github.com/llvm/llvm-project/commit/86edf90eb9ddb934f6c68184913cb970281b35a9
  Author: Domenic Nutile <domenic.nutile at gmail.com>
  Date:   2026-09-14 (Mon, 14 Sep 2026)

  Changed paths:
    M llvm/lib/Target/AMDGPU/AMDGPUInstructionSelector.cpp
    M llvm/test/CodeGen/AMDGPU/GlobalISel/combine-fma-sub-ext-neg-mul.ll
    M llvm/test/CodeGen/AMDGPU/GlobalISel/fdiv.f16.ll
    M llvm/test/CodeGen/AMDGPU/GlobalISel/fpow.ll
    M llvm/test/CodeGen/AMDGPU/mad-mix.ll

  Log Message:
  -----------
  [AMDGPU][GlobalISel] Fold neg/abs modifiers when mad-mix selects the low half

selectVOP3PMadMixModsImpl re-runs the fneg/fabs match after rewriting Src
to the 32-bit register the 16-bit value is a half of, but only did so on
the isExtractHiElt path, not for isExtractLoElt.

The two halves are not symmetric. An fneg/fabs of a 32-bit float only
touches bit 31, which is the sign bit of the high half, so folding it
into a modifier on the selected high half is correct. The low half's sign
bit is bit 15, which such an fneg/fabs leaves alone, so only a modifier
that acts on each 16-bit element can be folded there. So the source must be
a 2 x 16-bit vector to fold it.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list