[PATCH] D142746: AMDGPU: Fold fneg into bitcast of build_vector

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 27 09:24:38 PST 2023


arsenm created this revision.
arsenm added reviewers: AMDGPU, foad, rampitec, Pierre-vh.
Herald added subscribers: bzcheeseman, 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 math libraries have a lot of code that performs
manual sign bit operations by bitcasting doubles to int2
and doing bithacking on them. This is a bad canonical form
we should rewrite to use high level sign operations directly
on double. To avoid codegen regressions, we need to do a better
job moving fnegs to operate only on the high 32-bits.

      

This is only halfway to fixing the real case.


https://reviews.llvm.org/D142746

Files:
  llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp
  llvm/test/CodeGen/AMDGPU/fneg-modifier-casting.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D142746.492801.patch
Type: text/x-patch
Size: 8632 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230127/3c260598/attachment.bin>


More information about the llvm-commits mailing list