[llvm] [RISCV] Optimize bitcast to use dedicated fneg instruction (PR #216659)

via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 17 01:33:46 PDT 2026


================
@@ -3444,6 +3438,14 @@ class LLVM_ABI TargetLoweringBase {
     return false;
   }
 
+  /// Return true if the target should always perform FMA negation optimizations
+  /// even when isFNegFree returns true. This is used to handle target-specific
+  /// cases where FMA negation should be performed regardless of the general 
+  /// fneg cost model. 
+  virtual bool shouldAlwaysPerformFMANegOpt(EVT VT) const {
+    return false;
+  }
----------------
milkHongYe wrote:

Thank you for the feedback.

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


More information about the llvm-commits mailing list