[all-commits] [llvm/llvm-project] 91a7aa: [AMDGPU] Improve abs modifier usage

Thomas Symalla via All-commits all-commits at lists.llvm.org
Fri May 19 03:02:36 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 91a7aa4c9b29fa217f45badeaa87c4667a28f807
      https://github.com/llvm/llvm-project/commit/91a7aa4c9b29fa217f45badeaa87c4667a28f807
  Author: Thomas Symalla <github at thomassymalla.de>
  Date:   2023-05-19 (Fri, 19 May 2023)

  Changed paths:
    M llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp
    M llvm/lib/Target/AMDGPU/AMDGPUISelLowering.h
    M llvm/test/CodeGen/AMDGPU/andorbitset.ll
    M llvm/test/CodeGen/AMDGPU/bug-sdag-emitcopyfromreg.ll
    M llvm/test/CodeGen/AMDGPU/fold-fabs.ll

  Log Message:
  -----------
  [AMDGPU] Improve abs modifier usage

If a call to the llvm.fabs intrinsic has users in another reachable
BB, SelectionDAG will not apply the abs modifier to these users and
instead generate a v_and ..., 0x7fffffff instruction.
For fneg instructions, the issue is similar.
This patch implements `AMDGPUIselLowering::shouldSinkOperands`,
which allows CodegenPrepare to call `tryToSinkFreeOperands`.

Reviewed By: foad

Differential Revision: https://reviews.llvm.org/D150347




More information about the All-commits mailing list