[Mlir-commits] [mlir] [mlir][math] Expand powfI operation for constant power operand. (PR #87081)

Jakub Kuderski llvmlistbot at llvm.org
Sun Mar 31 12:12:40 PDT 2024


================
@@ -202,6 +210,70 @@ static LogicalResult convertCeilOp(math::CeilOp op, PatternRewriter &rewriter) {
   rewriter.replaceOp(op, ret);
   return success();
 }
+
+// Convert `math.fpowi` to a series of `arith.mulf` operations.
+// If the power is negative, we divide one by the result.
+static LogicalResult convertFPowICstOp(math::FPowIOp op,
+                                       PatternRewriter &rewriter) {
+  ImplicitLocOpBuilder b(op->getLoc(), rewriter);
+  Value base = op.getOperand(0);
----------------
kuhar wrote:

This variable is unused except for the `getType()` below. I don't think we need it. 

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


More information about the Mlir-commits mailing list