[llvm] [NVPTX] Lower -1/x to neg.f64(rcp.rn.f64) instead of fdiv (PR #98343)

Rajat Bajpai via llvm-commits llvm-commits at lists.llvm.org
Sat Jul 13 00:13:18 PDT 2024


================
@@ -1150,6 +1150,16 @@ def DoubleConst1 : PatLeaf<(fpimm), [{
   return &N->getValueAPF().getSemantics() == &llvm::APFloat::IEEEdouble() &&
          N->getValueAPF().convertToDouble() == 1.0;
 }]>;
+// Constant -1.0 (double)
+def DoubleConstNeg1 : PatLeaf<(fpimm), [{
+  return &N->getValueAPF().getSemantics() == &llvm::APFloat::IEEEdouble() &&
+         N->getValueAPF().convertToDouble() == -1.0;
+}]>;
+// Constant -1.0 -> 1.0 (double)
----------------
rajatbajpai wrote:

Thanks, resolved it in the latest changes.

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


More information about the llvm-commits mailing list