[PATCH] D128591: Transforms: Relax restrictions on pow(x, y) expansion

David Sherwood via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 28 06:55:58 PDT 2022


david-arm added inline comments.


================
Comment at: llvm/include/llvm/IR/Operator.h:263
 
+  bool hasFiniteMath() const { return hasNoNaNs() && hasNoInfs(); }
+
----------------
nit: Hi, I think this probably needs a simple comment here, something like

   /// Test if this operation's arguments and results are assumed to be finite.


================
Comment at: llvm/test/Transforms/InstCombine/pow-4.ll:32
+;
+  %1 = call reassoc nnan ninf nsz double @llvm.pow.f64(double %x, double 3.000000e+00)
+  ret double %1
----------------
It looks like the `nsz` flag is not needed here because the transformation only depends upon `reassoc nnan ninf` I think?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D128591



More information about the llvm-commits mailing list