[PATCH] D142418: AMDGPU: Teach fneg combines that select has source modifiers

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 23 16:27:54 PST 2023


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

We do match source modifiers for f32 typed selects already, but the
combiner code was never informed of this.

      

A long time ago the documentation lied and stated that source
modifiers don't work for v_cndmask_b32 when they in fact do. We had a
bunch fo code operating under the assumption that they don't support
source modifiers, so we tried to move fnegs around to work around
this.

      

Gets a few small improvements here and there. The main hazard to watch
out for is infinite loops in the combiner since we try to move fnegs
up and down the DAG.


https://reviews.llvm.org/D142418

Files:
  llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp
  llvm/test/CodeGen/AMDGPU/fmin_fmax_legacy.amdgcn.ll
  llvm/test/CodeGen/AMDGPU/fneg-combines.ll
  llvm/test/CodeGen/AMDGPU/fneg-combines.new.ll
  llvm/test/CodeGen/AMDGPU/fneg-modifier-casting.ll
  llvm/test/CodeGen/AMDGPU/select-fabs-fneg-extract-legacy.ll
  llvm/test/CodeGen/AMDGPU/select-fabs-fneg-extract.legal.f16.ll
  llvm/test/CodeGen/AMDGPU/select-fabs-fneg-extract.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D142418.491547.patch
Type: text/x-patch
Size: 25391 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230124/7357fbed/attachment.bin>


More information about the llvm-commits mailing list