[PATCH] D156676: AMDGPU: Remove pointless libcall recognition of native_{divide|recip}

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 31 05:15:19 PDT 2023


arsenm created this revision.
arsenm added reviewers: AMDGPU, rampitec, vpykhtin, jhuber6, dfukalov, yaxunl.
Herald added subscribers: foad, kerbowa, hiraditya, tpr, dstuttard, jvesely, kzhuravl.
Herald added a project: All.
arsenm requested review of this revision.
Herald added a subscriber: wdng.
Herald added a project: LLVM.

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

Files:
  llvm/lib/Target/AMDGPU/AMDGPULibCalls.cpp
  llvm/test/CodeGen/AMDGPU/simplify-libcalls.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D156676.545604.patch
Type: text/x-patch
Size: 4264 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230731/8b0081a2/attachment.bin>


More information about the llvm-commits mailing list