[llvm] [InstCombine] Fold fmod to frem if we know it does not set errno. (PR #107912)

David Green via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 12 13:19:23 PDT 2024


================
@@ -2278,8 +2278,8 @@ Value *LibCallSimplifier::replacePowWithSqrt(CallInst *Pow, IRBuilderBase &B) {
   // pow(-Inf, 0.5) is optionally required to have a result of +Inf (not setting
   // errno), but sqrt(-Inf) is required by various standards to set errno.
   if (!Pow->doesNotAccessMemory() && !Pow->hasNoInfs() &&
-      !isKnownNeverInfinity(Base, 0,
-                            SimplifyQuery(DL, TLI, /*DT=*/nullptr, AC, Pow)))
+      !isKnownNeverInfinity(
+          Base, 0, SimplifyQuery(DL, TLI, DT, AC, Pow, true, true, DC)))
----------------
davemgreen wrote:

I'll rebase over #108446 once it goes in, probably tomorrow morning.

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


More information about the llvm-commits mailing list