Lines Matching refs:rewriter

88                   ConversionPatternRewriter &rewriter) const override;
99 ConversionPatternRewriter &rewriter) const override;
108 ConversionPatternRewriter &rewriter) const override;
117 ConversionPatternRewriter &rewriter) const override;
128 ConversionPatternRewriter &rewriter, in replaceSCFOutputValue() argument
141 rewriter.setInsertionPoint(newOp); in replaceSCFOutputValue()
142 auto alloc = rewriter.create<spirv::VariableOp>( in replaceSCFOutputValue()
146 rewriter.setInsertionPointAfter(newOp); in replaceSCFOutputValue()
147 Value loadResult = rewriter.create<spirv::LoadOp>(loc, alloc); in replaceSCFOutputValue()
150 rewriter.replaceOp(scfOp, resultValue); in replaceSCFOutputValue()
163 ConversionPatternRewriter &rewriter) const { in matchAndRewrite()
170 auto loopOp = rewriter.create<spirv::LoopOp>(loc, spirv::LoopControl::None); in matchAndRewrite()
173 OpBuilder::InsertionGuard guard(rewriter); in matchAndRewrite()
195 body = rewriter.applySignatureConversion(&forOp.getLoopBody(), in matchAndRewrite()
200 rewriter.inlineRegionBefore(forOp->getRegion(0), loopOp.body(), in matchAndRewrite()
206 rewriter.setInsertionPointToEnd(&(loopOp.body().front())); in matchAndRewrite()
207 rewriter.create<spirv::BranchOp>(loc, header, args); in matchAndRewrite()
210 rewriter.setInsertionPointToEnd(header); in matchAndRewrite()
212 auto cmpOp = rewriter.create<spirv::SLessThanOp>( in matchAndRewrite()
213 loc, rewriter.getI1Type(), newIndVar, adaptor.getUpperBound()); in matchAndRewrite()
215 rewriter.create<spirv::BranchConditionalOp>( in matchAndRewrite()
221 rewriter.setInsertionPointToEnd(continueBlock); in matchAndRewrite()
224 Value updatedIndVar = rewriter.create<spirv::IAddOp>( in matchAndRewrite()
226 rewriter.create<spirv::BranchOp>(loc, header, updatedIndVar); in matchAndRewrite()
235 replaceSCFOutputValue(forOp, loopOp, rewriter, scfToSPIRVContext, initTypes); in matchAndRewrite()
245 ConversionPatternRewriter &rewriter) const { in matchAndRewrite()
253 rewriter.create<spirv::SelectionOp>(loc, spirv::SelectionControl::None); in matchAndRewrite()
255 rewriter.createBlock(&selectionOp.body(), selectionOp.body().end()); in matchAndRewrite()
256 rewriter.create<spirv::MergeOp>(loc); in matchAndRewrite()
258 OpBuilder::InsertionGuard guard(rewriter); in matchAndRewrite()
260 rewriter.createBlock(&selectionOp.body().front()); in matchAndRewrite()
265 rewriter.setInsertionPointToEnd(&thenRegion.back()); in matchAndRewrite()
266 rewriter.create<spirv::BranchOp>(loc, mergeBlock); in matchAndRewrite()
267 rewriter.inlineRegionBefore(thenRegion, mergeBlock); in matchAndRewrite()
275 rewriter.setInsertionPointToEnd(&elseRegion.back()); in matchAndRewrite()
276 rewriter.create<spirv::BranchOp>(loc, mergeBlock); in matchAndRewrite()
277 rewriter.inlineRegionBefore(elseRegion, mergeBlock); in matchAndRewrite()
281 rewriter.setInsertionPointToEnd(selectionHeaderBlock); in matchAndRewrite()
282 rewriter.create<spirv::BranchConditionalOp>(loc, adaptor.getCondition(), in matchAndRewrite()
291 replaceSCFOutputValue(ifOp, selectionOp, rewriter, scfToSPIRVContext, in matchAndRewrite()
305 ConversionPatternRewriter &rewriter) const { in matchAndRewrite()
317 rewriter.create<spirv::StoreOp>(loc, allocas[i], operands[i]); in matchAndRewrite()
321 cast<spirv::BranchOp>(rewriter.getInsertionBlock()->getTerminator()); in matchAndRewrite()
324 rewriter.setInsertionPoint(br); in matchAndRewrite()
325 rewriter.create<spirv::BranchOp>(terminatorOp.getLoc(), br.getTarget(), in matchAndRewrite()
327 rewriter.eraseOp(br); in matchAndRewrite()
330 rewriter.eraseOp(terminatorOp); in matchAndRewrite()
340 ConversionPatternRewriter &rewriter) const { in matchAndRewrite()
342 auto loopOp = rewriter.create<spirv::LoopOp>(loc, spirv::LoopControl::None); in matchAndRewrite()
345 OpBuilder::InsertionGuard guard(rewriter); in matchAndRewrite()
357 if (failed(rewriter.getRemappedValues(cond.getArgs(), condArgs))) in matchAndRewrite()
360 Value conditionVal = rewriter.getRemappedValue(cond.getCondition()); in matchAndRewrite()
366 if (failed(rewriter.getRemappedValues(yield.getResults(), yieldArgs))) in matchAndRewrite()
370 rewriter.inlineRegionBefore(beforeRegion, loopOp.body(), in matchAndRewrite()
374 rewriter.inlineRegionBefore(afterRegion, loopOp.body(), in matchAndRewrite()
378 rewriter.setInsertionPointToEnd(&entryBlock); in matchAndRewrite()
379 rewriter.create<spirv::BranchOp>(loc, &beforeBlock, adaptor.getInits()); in matchAndRewrite()
398 rewriter.setInsertionPoint(loopOp); in matchAndRewrite()
399 auto alloc = rewriter.create<spirv::VariableOp>( in matchAndRewrite()
404 rewriter.setInsertionPointAfter(loopOp); in matchAndRewrite()
405 auto loadResult = rewriter.create<spirv::LoadOp>(condLoc, alloc); in matchAndRewrite()
409 rewriter.setInsertionPointToEnd(&beforeBlock); in matchAndRewrite()
410 rewriter.create<spirv::StoreOp>(condLoc, alloc, res); in matchAndRewrite()
413 rewriter.setInsertionPointToEnd(&beforeBlock); in matchAndRewrite()
414 rewriter.replaceOpWithNewOp<spirv::BranchConditionalOp>( in matchAndRewrite()
418 rewriter.setInsertionPointToEnd(&afterBlock); in matchAndRewrite()
419 rewriter.replaceOpWithNewOp<spirv::BranchOp>(yield, &beforeBlock, yieldArgs); in matchAndRewrite()
421 rewriter.replaceOp(whileOp, resultValues); in matchAndRewrite()