[llvm] [AArch64][GlobalISel] Protect against fdiv of 1 (PR #184063)

David Green via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 11 09:50:49 PDT 2026


================
@@ -6819,9 +6819,13 @@ bool CombinerHelper::matchRepeatedFPDivisor(
   if (!MI.getFlag(MachineInstr::MIFlag::FmArcp))
     return false;
 
+  auto IsOne = [this](Register X) {
----------------
davemgreen wrote:

We generate `fdiv 1.0 / x`, so this is a fairly direct check against the offending pattern. Unless you had something else in mind?

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


More information about the llvm-commits mailing list