[PATCH] D143941: AMDGPU: Teach getNegatedExpression about rcp

Jay Foad via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 15 01:38:25 PST 2023


foad added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp:809
+    SDValue NegSrc = getNegatedExpression(Src, DAG, LegalOperations,
+                                          ForCodeSize, Cost, Depth);
+    if (NegSrc)
----------------
`Depth + 1`?


================
Comment at: llvm/test/CodeGen/AMDGPU/fneg-combines.new.ll:2033
 ; GCN-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
-; GCN-NEXT:    v_fma_f32 v0, -v0, v1, -2.0
+; GCN-NEXT:    v_fma_f32 v0, v0, v1, 2.0
 ; GCN-NEXT:    v_rcp_f32_e32 v0, v0
----------------
This codegen isn't actually any better, is it?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D143941/new/

https://reviews.llvm.org/D143941



More information about the llvm-commits mailing list