[PATCH] D156706: AMDGPU: Simplify and improve sincos matching

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 31 08:54:00 PDT 2023


arsenm created this revision.
arsenm added reviewers: AMDGPU, rampitec, vpykhtin, dfukalov, jmmartinez, jhuber6, yaxunl, Pierre-vh.
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.

The first trivial example I tried failed to merge due to the user scan
logic. Remove the complicated scan of users handling with distance
thresholds, with a same block restriction. The actual expansion of
sincos is basically the same size as sin or cos individually. Copy the
technique the generic optimization uses, which is to just use the
input instruction as the insert point or just insert at the start of
the entry block.


https://reviews.llvm.org/D156706

Files:
  llvm/lib/Target/AMDGPU/AMDGPULibCalls.cpp
  llvm/test/CodeGen/AMDGPU/amdgpu-simplify-libcall-sincos.defined.ll
  llvm/test/CodeGen/AMDGPU/amdgpu-simplify-libcall-sincos.defined.nobuiltin.ll
  llvm/test/CodeGen/AMDGPU/amdgpu-simplify-libcall-sincos.ll
  llvm/test/CodeGen/AMDGPU/amdgpu-simplify-libcall-sincos.nobuiltins.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D156706.545694.patch
Type: text/x-patch
Size: 71588 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230731/61850f07/attachment.bin>


More information about the llvm-commits mailing list