[all-commits] [llvm/llvm-project] 6448d5: AMDGPU: Remove pointless libcall recognition of na...

Matt Arsenault via All-commits all-commits at lists.llvm.org
Wed Aug 9 15:49:00 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 6448d5ba581a275ddaf9504368690abcf1aec244
      https://github.com/llvm/llvm-project/commit/6448d5ba581a275ddaf9504368690abcf1aec244
  Author: Matt Arsenault <Matthew.Arsenault at amd.com>
  Date:   2023-08-09 (Wed, 09 Aug 2023)

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

  Log Message:
  -----------
  AMDGPU: Remove pointless libcall recognition of native_{divide|recip}

This was trying to constant fold these calls, and also turn some of
them into a regular fmul/fdiv. There's no point to doing that, the
underlying library implementation should be using those in the first
place. Even when the library does use the rcp intrinsics, the backend
handles constant folding of those. This was also only performing the
folds under overly strict fast-evertyhing-is-required conditions.

The one possible plus this gained over linking in the library is if
you were using all fast math flags, it would propagate them to the new
instructions. We could address this in the library by adding more fast
math flags to the native implementations.

The constant fold case also had no test coverage.

https://reviews.llvm.org/D156676




More information about the All-commits mailing list