[PATCH] D150011: AMDGPU: Pattern match fract instructions in AMDGPUCodeGenPrepare

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 5 17:31:04 PDT 2023


arsenm created this revision.
arsenm added reviewers: AMDGPU, foad, b-sumner, Pierre-vh.
Herald added subscribers: kosarev, StephenFan, kerbowa, hiraditya, tpr, dstuttard, yaxunl, jvesely, kzhuravl.
Herald added a project: All.
arsenm requested review of this revision.
Herald added a subscriber: wdng.
Herald added a project: LLVM.

This will allow eliminating the intrinsic uses in the device
libraries, which will remove a subtarget dependency on the f16
version of the intrinsic.

      

We previously had some wrong patterns for this under unsafe math
which I've removed.

      

Do it in IR partially to take advantage of the much better isKnownNeverNaN
handling, and partially out of laziness to avoid repeating this in the DAG
and GlobalISel path. Plus I think this should be done much earlier. Ideally
this would be in InstCombine, but you can't introduce target intrinsics
from a generic instruction rooted pattern.


https://reviews.llvm.org/D150011

Files:
  llvm/lib/Target/AMDGPU/AMDGPUCodeGenPrepare.cpp
  llvm/lib/Target/AMDGPU/SIInstructions.td
  llvm/test/CodeGen/AMDGPU/fract-match.ll
  llvm/test/CodeGen/AMDGPU/fract.f64.ll
  llvm/test/CodeGen/AMDGPU/fract.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D150011.520009.patch
Type: text/x-patch
Size: 112383 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230506/ba4faebd/attachment-0001.bin>


More information about the llvm-commits mailing list