@@ -90,12 +90,12 @@ struct DepthwiseConv2DIsMul : public OpRewritePattern<tosa::DepthwiseConv2DOp> {
9090
9191 if (inputETy != resultETy) {
9292 inputType = inputType.clone (resultETy);
93- input = rewriter. create < tosa::CastOp>( op.getLoc (), inputType, input);
93+ input = tosa::CastOp::create (rewriter, op.getLoc (), inputType, input);
9494 }
9595
9696 if (weightETy != resultETy) {
9797 weightType = weightType.clone (resultETy);
98- weight = rewriter. create < tosa::CastOp>( op.getLoc (), weightType, weight);
98+ weight = tosa::CastOp::create (rewriter, op.getLoc (), weightType, weight);
9999 }
100100
101101 if (iZp != 0 || wZp != 0 ) {
@@ -109,9 +109,9 @@ struct DepthwiseConv2DIsMul : public OpRewritePattern<tosa::DepthwiseConv2DOp> {
109109 auto zpTy = RankedTensorType::get (shape, ety);
110110 auto zpAttr =
111111 DenseElementsAttr::get (zpTy, rewriter.getIntegerAttr (ety, zp));
112- auto zpVal = rewriter. create < tosa::ConstOp>( op.getLoc (), zpTy, zpAttr);
113- return rewriter. create < tosa::SubOp>( op.getLoc (), val.getType (), val,
114- zpVal);
112+ auto zpVal = tosa::ConstOp::create (rewriter, op.getLoc (), zpTy, zpAttr);
113+ return tosa::SubOp::create (rewriter, op.getLoc (), val.getType (), val,
114+ zpVal);
115115 };
116116
117117 input = applyZp (input, iZp);
@@ -138,10 +138,10 @@ struct DepthwiseConv2DIsMul : public OpRewritePattern<tosa::DepthwiseConv2DOp> {
138138 auto padTy = RankedTensorType::get ({1 }, inputETy);
139139 auto padAttr = DenseElementsAttr::get (padTy, zeroAttr);
140140 Value padVal =
141- rewriter. create < tosa::ConstOp>( op->getLoc (), padTy, padAttr);
141+ tosa::ConstOp::create (rewriter, op->getLoc (), padTy, padAttr);
142142 inputType = RankedTensorType::get (newShape, inputETy);
143- input = rewriter. create < tosa::PadOp>( op->getLoc (), inputType, input,
144- padSizeVal, padVal);
143+ input = tosa::PadOp::create (rewriter, op->getLoc (), inputType, input,
144+ padSizeVal, padVal);
145145 }
146146
147147 // Perform an elementwise mul over the reshaped input and weight.
@@ -161,7 +161,7 @@ struct DepthwiseConv2DIsMul : public OpRewritePattern<tosa::DepthwiseConv2DOp> {
161161 auto shiftZeroAttr = DenseElementsAttr::get (
162162 shiftType, rewriter.getIntegerAttr (shiftElementType, 0 ));
163163 Value constZero =
164- rewriter. create < tosa::ConstOp>( op.getLoc (), shiftType, shiftZeroAttr);
164+ tosa::ConstOp::create (rewriter, op.getLoc (), shiftType, shiftZeroAttr);
165165 Value mulValue = rewriter
166166 .create <tosa::MulOp>(op.getLoc (), mulShapeType, input,
167167 weight, constZero)
@@ -174,8 +174,8 @@ struct DepthwiseConv2DIsMul : public OpRewritePattern<tosa::DepthwiseConv2DOp> {
174174 dyn_cast<RankedTensorType>(input.getType ()).getElementType ());
175175 auto outputShapeValue =
176176 getTosaConstShape (rewriter, op->getLoc (), outputShape);
177- Value outputValue = rewriter. create < tosa::ReshapeOp> (
178- op.getLoc (), outputShapeType, mulValue, outputShapeValue);
177+ Value outputValue = tosa::ReshapeOp::create (
178+ rewriter, op.getLoc (), outputShapeType, mulValue, outputShapeValue);
179179
180180 Value bias = op.getBias ();
181181 if (EqualizeRanks (rewriter, op.getLoc (), outputValue, bias).failed ()) {
0 commit comments