================
@@ -175,12 +176,20 @@ PowIStrengthReduction<PowIOpTy, DivOpTy,
MulOpTy>::matchAndRewrite(
Value one;
Type opType = getElementTypeOrSelf(op.getType());
- if constexpr (std::is_same_v<PowIOpTy, math::FPowIOp>)
+ if constexpr (std::is_same_v<PowIOpTy, math::FPowIOp>) {
one = arith::ConstantOp::create(rewriter, loc,
rewriter.getFloatAttr(opType, 1.0));
- else
+ } else if constexpr (std::is_same_v<PowIOpTy, complex::PowiOp>) {
+ auto complexTy = cast<ComplexType>(opType);
+ Type elementType = complexTy.getElementType();
+ auto realPart = rewriter.getFloatAttr(elementType, 1.0);
+ auto imagPart = rewriter.getFloatAttr(elementType, 0.0);
+ one = rewriter.create<complex::ConstantOp>(
----------------
TIFitis wrote:
Done.
https://github.com/llvm/llvm-project/pull/158722
_______________________________________________
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits