[PATCH] D136098: InstCombine: Fold fdiv nnan x, 0 -> copysign(inf, x)

Kevin P. Neal via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 17 12:52:21 PDT 2022


kpn added inline comments.


================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp:1375
 /// Remove negation and try to convert division into multiplication.
-static Instruction *foldFDivConstantDivisor(BinaryOperator &I) {
+Instruction *InstCombinerImpl::foldFDivConstantDivisor(BinaryOperator &I) {
   Constant *C;
----------------
Is this part of a future change? I'm wondering if it belongs in this patch.


================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp:1396
+    return replaceInstUsesWith(I, CopySign);
+  }
+
----------------
This looks fine to me, but I'll let Sanjay give the word. I've never worked in InstCombine.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D136098/new/

https://reviews.llvm.org/D136098



More information about the llvm-commits mailing list