[llvm] GlobalISel needs fdiv 1 / sqrt(x) to rsq combine (PR #78673)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 8 01:37:18 PST 2024


================
@@ -337,32 +337,24 @@ bool AMDGPUPostLegalizerCombinerImpl::matchRcpSqrtToRsq(
   return false;
 }
 
-bool AMDGPUPostLegalizerCombinerImpl::matchFDivSqrtToRsq(
+bool AMDGPUPostLegalizerCombinerImpl::matchFDivSqrtToRsqF16(
     MachineInstr &MI) const {
   Register Dst = MI.getOperand(0).getReg();
   Register Sqrt = MI.getOperand(2).getReg();
   LLT DstTy = MRI.getType(Dst);
-  const MachineFunction &MF = B.getMF();
-  bool AllowInaccurateRsq =
-      MI.getFlag(MachineInstr::FmAfn) || MF.getTarget().Options.UnsafeFPMath;
   if (!MRI.hasOneUse(Sqrt)) {
----------------
arsenm wrote:

I thought we had combiner magic for hasOneUse but I'm not finding it. Also, this should really have been hasOneNonDbgUse 

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


More information about the llvm-commits mailing list