[llvm] [NVPTX] designate fabs and fneg as free (PR #121513)

Artem Belevich via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 7 14:10:49 PST 2025


================
@@ -261,6 +261,9 @@ class NVPTXTargetLowering : public TargetLowering {
     return true;
   }
 
+  bool isFAbsFree(EVT VT) const override { return true; }
+  bool isFNegFree(EVT VT) const override { return true; }
----------------
Artem-B wrote:

What do we get in SASS for those? I do not see any FABS/FNEG instructions in https://docs.nvidia.com/cuda/cuda-binary-utilities/index.html#hopper-instruction-set

If ptxas ends up lowering fabs/fneg to the logical ops, we may as well let LLVM do it which may let it optimize some of that away better than ptxas.

https://github.com/llvm/llvm-project/pull/121513


More information about the llvm-commits mailing list