Constant fold powf, given two constant operands and a compatible type
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
mlir/lib/Dialect/Math/IR/MathOps.cpp | ||
---|---|---|
93 | Should we rather check for ft.getFloatSemantics() being Double/Float here? |
mlir/lib/Dialect/Math/IR/MathOps.cpp | ||
---|---|---|
93 | I'm not aware of a good check on fltSemantics for that (https://llvm.org/doxygen/structllvm_1_1fltSemantics.html). If you know a better check, would be happy to use (and presumably also check the log2 one above). If I recall from the log2 case this is what LLVM itself does presently. |
mlir/lib/Dialect/Math/IR/MathOps.cpp | ||
---|---|---|
93 | &APFloatBase::getIEEESingle() == &ft.getFloatSemantics() ? AFAIK, these are singleton objects return by-reference so you can just compare their addresses. |
mlir/lib/Dialect/Math/IR/MathOps.cpp | ||
---|---|---|
76 | Float-like means it's a float scalar, a vector of floats or a tensor of floats. The logic below only applies to float scalars, so the check is required. |
mlir/lib/Dialect/Math/IR/MathOps.cpp | ||
---|---|---|
76 | Oh, missed that, thanks. |
The op definition guarantees that the result is float-like. Things enforced by the verifier need not be re-checked.