[all-commits] [llvm/llvm-project] daecc3: AMDGPU: Replace sqrt OpenCL libcalls with llvm.sqr...

Matt Arsenault via All-commits all-commits at lists.llvm.org
Tue Jan 9 00:14:11 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: daecc303bb719ed63566fcb343afec169826f82c
      https://github.com/llvm/llvm-project/commit/daecc303bb719ed63566fcb343afec169826f82c
  Author: Matt Arsenault <Matthew.Arsenault at amd.com>
  Date:   2024-01-09 (Tue, 09 Jan 2024)

  Changed paths:
    M llvm/lib/Target/AMDGPU/AMDGPULibCalls.cpp
    M llvm/test/CodeGen/AMDGPU/amdgpu-simplify-libcall-sqrt.ll
    M llvm/test/CodeGen/AMDGPU/simplify-libcalls.ll

  Log Message:
  -----------
  AMDGPU: Replace sqrt OpenCL libcalls with llvm.sqrt (#74197)

The library implementation is just a wrapper around a call to the
intrinsic, but loses metadata. Swap out the call site to the intrinsic
so that the lowering can see the !fpmath metadata and fast math flags.

Since d56e0d07cc5ee8e334fd1ad403eef0b1a771384f, clang started placing
!fpmath on OpenCL library sqrt calls. Also don't bother emitting
native_sqrt anymore, it's just another wrapper around llvm.sqrt.




More information about the All-commits mailing list