[PATCH] D142641: AMDGPU: Force sign operand of f64 fcopysign to f32

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 26 08:27:39 PST 2023


arsenm created this revision.
arsenm added reviewers: AMDGPU, rampitec, foad, sebastian-ne, 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.

The fcopysign DAG operation, unlike the IR one, allows
different types for the sign and magnitude. We can reduce
the bitwidth of the high operand since only the sign bit matters.

      

The default combine only introduces mixed fcopysign
operand types from fpext/fptrunc. We effectively do this
already during selection, but doing it earlier in the combiner
should expose new combine opportunities (e.g. the existing tests
now eliminate the load of the low half of the double). Unfortunately
this isn't enough to handle the case I'm interested in just yet.


https://reviews.llvm.org/D142641

Files:
  llvm/lib/Target/AMDGPU/SIISelLowering.cpp
  llvm/lib/Target/AMDGPU/SIISelLowering.h
  llvm/test/CodeGen/AMDGPU/fcopysign.f16.ll
  llvm/test/CodeGen/AMDGPU/fcopysign.f64.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D142641.492462.patch
Type: text/x-patch
Size: 4779 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230126/eae276cf/attachment.bin>


More information about the llvm-commits mailing list