[PATCH] D150347: [AMDGPU] Improve abs modifier usage

Thomas Symalla via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 11 01:12:48 PDT 2023


tsymalla created this revision.
tsymalla added a reviewer: nhaehnle.
Herald added subscribers: foad, kerbowa, hiraditya, tpr, dstuttard, yaxunl, jvesely, kzhuravl, arsenm.
Herald added a project: All.
tsymalla requested review of this revision.
Herald added subscribers: llvm-commits, wdng.
Herald added a project: LLVM.

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.
The change clones the IR instruction if appropriate and adjusts
the users in the other basic blocks to use the new clone.
If there is no user in the current BB, the compiler will try to remove
original instruction if it is safe to do so.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D150347

Files:
  llvm/lib/Target/AMDGPU/AMDGPULateCodeGenPrepare.cpp
  llvm/test/CodeGen/AMDGPU/bug-sdag-emitcopyfromreg.ll
  llvm/test/CodeGen/AMDGPU/fold-fabs.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D150347.521223.patch
Type: text/x-patch
Size: 17907 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230511/2b0c9f27/attachment.bin>


More information about the llvm-commits mailing list