[llvm] [SPARC] Use FMA instructions when we have UA2007 (PR #148434)

via llvm-commits llvm-commits at lists.llvm.org
Sat Jul 19 21:39:45 PDT 2025


================
@@ -3570,6 +3572,15 @@ bool SparcTargetLowering::isCheapToSpeculateCttz(Type *Ty) const {
   return isCheapToSpeculateCtlz(Ty);
 }
 
+bool SparcTargetLowering::isFMAFasterThanFMulAndFAdd(const MachineFunction &MF,
+                                                     EVT VT) const {
+  return Subtarget->isUA2007();
+}
+
+bool SparcTargetLowering::enableAggressiveFMAFusion(EVT VT) const {
+  return Subtarget->isUA2007();
+}
+
----------------
koachan wrote:

Added some combine tests, would that be enough?

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


More information about the llvm-commits mailing list