Home
last modified time | relevance | path

Searched refs:rewriter (Results 1 – 25 of 276) sorted by relevance

12345678910>>...12

/llvm-project-15.0.7/mlir/lib/Conversion/TosaToLinalg/
H A DTosaToLinalg.cpp108 a = rewriter.create<arith::ExtSIOp>(loc, rewriter.getI32Type(), a); in createLinalgBodyCalculationForElementwiseOp()
111 b = rewriter.create<arith::ExtSIOp>(loc, rewriter.getI32Type(), b); in createLinalgBodyCalculationForElementwiseOp()
479 rewriter in createLinalgBodyCalculationForElementwiseOp()
1684 rewriter in matchAndRewrite()
1874 rewriter.create<arith::ConstantOp>(loc, rewriter.getIndexAttr(0)); in matchAndRewrite()
1951 rewriter in matchAndRewrite()
1958 rewriter in matchAndRewrite()
1978 rewriter in matchAndRewrite()
2063 rewriter in matchAndRewrite()
2071 {rewriter.getAffineDimExpr(0), rewriter.getAffineDimExpr(1)}, in matchAndRewrite()
[all …]
H A DTosaToLinalgNamed.cpp127 rewriter); in inferDynamicDimsForConv()
140 rewriter); in inferDynamicDimsForConv()
267 {rewriter.getAffineDimExpr(3)}, rewriter.getContext())); in matchAndRewrite()
283 rewriter in matchAndRewrite()
312 rewriter in matchAndRewrite()
424 {rewriter.getAffineDimExpr(3)}, rewriter.getContext())); in matchAndRewrite()
625 rewriter in matchAndRewrite()
659 rewriter in matchAndRewrite()
666 rewriter in matchAndRewrite()
739 rewriter in matchAndRewrite()
[all …]
/llvm-project-15.0.7/mlir/lib/Conversion/SCFToControlFlow/
H A DSCFToControlFlow.cpp326 rewriter.eraseOp(terminator); in matchAndRewrite()
385 rewriter.eraseOp(thenTerminator); in matchAndRewrite()
399 rewriter.eraseOp(elseTerminator); in matchAndRewrite()
431 rewriter.eraseOp(terminator); in matchAndRewrite()
442 rewriter.replaceOp(op, vals); in matchAndRewrite()
479 rewriter.setInsertionPointToEnd(rewriter.getInsertionBlock()); in matchAndRewrite()
499 rewriter.eraseOp(reduce); in matchAndRewrite()
514 rewriter.setInsertionPointToEnd(rewriter.getInsertionBlock()); in matchAndRewrite()
525 OpBuilder::InsertionGuard guard(rewriter); in matchAndRewrite()
531 rewriter.splitBlock(currentBlock, rewriter.getInsertionPoint()); in matchAndRewrite()
[all …]
/llvm-project-15.0.7/mlir/lib/Conversion/TosaToArith/
H A DTosaToArith.cpp50 return rewriter.getIntegerAttr(type, value); in getConstantAttr()
54 PatternRewriter &rewriter) { in getConstantValue() argument
55 return rewriter.create<arith::ConstantOp>( in getConstantValue()
56 loc, getConstantAttr(type, value, rewriter)); in getConstantValue()
101 Value positive = rewriter.create<arith::CmpIOp>( in matchAndRewrite()
106 Value valid = rewriter.create<arith::CmpIOp>( in matchAndRewrite()
115 rewriter.replaceOp(op, result32); in matchAndRewrite()
163 Value shiftOver32 = rewriter.create<arith::CmpIOp>( in matchAndRewrite()
165 Value roundHighBits = rewriter.create<arith::CmpIOp>( in matchAndRewrite()
208 Value wasRounded = rewriter.create<arith::CmpIOp>( in matchAndRewrite()
[all …]
/llvm-project-15.0.7/mlir/lib/Conversion/MemRefToLLVM/
H A DMemRefToLLVM.cpp228 rewriter.splitBlock(currentBlock, rewriter.getInsertionPoint()); in matchAndRewrite()
304 rewriter.eraseOp(op); in matchAndRewrite()
352 rewriter.replaceOp( in matchAndRewrite()
359 rewriter.replaceOp( in matchAndRewrite()
764 rewriter.replaceOp(op, {desc.rank(rewriter, loc)}); in matchAndRewrite()
849 rewriter in rewrite()
1284 rewriter.splitBlock(condBlock, rewriter.getInsertionPoint()); in convertSourceMemRefToDescriptor()
1306 rewriter.splitBlock(bodyBlock, rewriter.getInsertionPoint()); in convertSourceMemRefToDescriptor()
1519 rewriter.splitBlock(initBlock, rewriter.getInsertionPoint()); in fillInStridesForCollapsedMemDescriptor()
1595 dstDesc.setAlignedPtr(rewriter, loc, srcDesc.alignedPtr(rewriter, loc)); in matchAndRewrite()
[all …]
/llvm-project-15.0.7/mlir/lib/Conversion/VectorToLLVM/
H A DConvertVectorToLLVM.cpp879 rewriter.replaceOp(op, desc); in matchAndRewrite()
969 auto attr = rewriter.getIntegerAttr(rewriter.getIndexType(), 0); in matchAndRewrite()
978 rewriter.getIntegerAttr(rewriter.getIndexType(), indexedSize.value()); in matchAndRewrite()
981 auto strideAttr = rewriter.getIntegerAttr(rewriter.getIndexType(), in matchAndRewrite()
1008 force32BitVectorIndices ? rewriter.getI32Type() : rewriter.getI64Type(); in matchAndRewrite()
1105 rewriter.eraseOp(printOp); in matchAndRewrite()
1141 emitCall(rewriter, loc, in emitRanks()
1159 rewriter, loc, in emitRanks()
1175 emitCall(rewriter, loc, in emitRanks()
1205 rewriter.getZeroAttr(rewriter.getIntegerType(32))); in matchAndRewrite()
[all …]
/llvm-project-15.0.7/flang/lib/Optimizer/Transforms/
H A DRewriteLoop.cpp47 auto initPos = rewriter.getInsertionPoint(); in matchAndRewrite()
69 rewriter.setInsertionPointToEnd(initBlock); in matchAndRewrite()
111 rewriter.eraseOp(terminator); in matchAndRewrite()
119 rewriter.create<mlir::cf::CondBranchOp>( in matchAndRewrite()
158 continueBlock = rewriter.createBlock( in matchAndRewrite()
173 rewriter.eraseOp(ifOpTerminator); in matchAndRewrite()
188 rewriter.eraseOp(otherwiseTerm); in matchAndRewrite()
193 rewriter.create<mlir::cf::CondBranchOp>( in matchAndRewrite()
250 rewriter.eraseOp(terminator); in matchAndRewrite()
286 rewriter.create<mlir::cf::CondBranchOp>( in matchAndRewrite()
[all …]
/llvm-project-15.0.7/mlir/lib/Conversion/SCFToSPIRV/
H A DSCFToSPIRV.cpp141 rewriter.setInsertionPoint(newOp); in replaceSCFOutputValue()
146 rewriter.setInsertionPointAfter(newOp); in replaceSCFOutputValue()
150 rewriter.replaceOp(scfOp, resultValue); in replaceSCFOutputValue()
173 OpBuilder::InsertionGuard guard(rewriter); in matchAndRewrite()
210 rewriter.setInsertionPointToEnd(header); in matchAndRewrite()
256 rewriter.create<spirv::MergeOp>(loc); in matchAndRewrite()
258 OpBuilder::InsertionGuard guard(rewriter); in matchAndRewrite()
324 rewriter.setInsertionPoint(br); in matchAndRewrite()
327 rewriter.eraseOp(br); in matchAndRewrite()
330 rewriter.eraseOp(terminatorOp); in matchAndRewrite()
[all …]
/llvm-project-15.0.7/mlir/lib/Conversion/ComplexToLLVM/
H A DComplexToLLVM.cpp88 *getTypeConverter(), rewriter); in matchAndRewrite()
119 rewriter.replaceOp(op, real); in matchAndRewrite()
134 rewriter.replaceOp(op, imaginary); in matchAndRewrite()
183 result.setReal(rewriter, loc, real); in matchAndRewrite()
186 rewriter.replaceOp(op, {result}); in matchAndRewrite()
225 rewriter, loc, in matchAndRewrite()
228 rewriter, loc, in matchAndRewrite()
231 rewriter.replaceOp(op, {result}); in matchAndRewrite()
265 result.setReal(rewriter, loc, real); in matchAndRewrite()
268 rewriter.replaceOp(op, {result}); in matchAndRewrite()
[all …]
/llvm-project-15.0.7/mlir/lib/Conversion/GPUCommon/
H A DGPUOpsLowering.cpp36 auto globalOp = rewriter.create<LLVM::GlobalOp>( in matchAndRewrite()
80 OpBuilder::InsertionGuard guard(rewriter); in matchAndRewrite()
96 Value memory = rewriter.create<LLVM::GEPOp>( in matchAndRewrite()
145 rewriter.eraseOp(gpuFuncOp); in matchAndRewrite()
168 ConversionPatternRewriter &rewriter) const { in matchAndRewrite()
221 global = rewriter.create<LLVM::GlobalOp>( in matchAndRewrite()
224 rewriter.getStringAttr(formatString)); in matchAndRewrite()
262 arg = rewriter.create<LLVM::FPExtOp>( in matchAndRewrite()
281 rewriter.eraseOp(gpuPrintfOp); in matchAndRewrite()
320 global = rewriter.create<LLVM::GlobalOp>( in matchAndRewrite()
[all …]
H A DGPUToLLVMConversion.cpp317 rewriter.eraseOp(op); in matchAndRewrite()
405 return rewriter.notifyMatchFailure( in areAllLLVMTypes()
414 return rewriter.notifyMatchFailure( in isAsyncWithOneDependency()
441 rewriter.eraseOp(op); in matchAndRewrite()
535 rewriter.updateRootInPlace(yieldOp, in matchAndRewrite()
573 rewriter.eraseOp(waitOp); in matchAndRewrite()
616 rewriter.replaceOp(waitOp, {stream}); in matchAndRewrite()
722 return rewriter.notifyMatchFailure( in matchAndRewrite()
775 loc, rewriter, in matchAndRewrite()
790 rewriter.eraseOp(launchOp); in matchAndRewrite()
[all …]
/llvm-project-15.0.7/flang/lib/Optimizer/CodeGen/
H A DCodeGen.cpp190 rewriter); in loadStrideFromBox()
441 rewriter.replaceOp(boxaddr, loadBaseAddrFromBox(loc, ty, a, rewriter)); in matchAndRewrite()
542 getValueFromBox(loc, a, rewriter.getI32Type(), rewriter, kRankPosInBox); in matchAndRewrite()
654 rewriter.replaceOp(constop, cst); in matchAndRewrite()
1105 rewriter.eraseOp(freemem); in matchAndRewrite()
1607 loc, i64Ty, rewriter, in matchAndRewrite()
1936 rewriter); in reshapeBox()
2715 rewriter.eraseOp(global); in matchAndRewrite()
2941 selector = rewriter.create<mlir::LLVM::TruncOp>(loc, rewriter.getI32Type(), in selectMatchAndRewrite()
3039 rewriter.replaceOp(unboxchar, in matchAndRewrite()
[all …]
/llvm-project-15.0.7/mlir/lib/Dialect/Math/Transforms/
H A DExpandPatterns.cpp28 auto floatOne = rewriter.getFloatAttr(floatType, 1.0); in convertTanhOp()
29 auto floatTwo = rewriter.getFloatAttr(floatType, 2.0); in convertTanhOp()
42 exp2x = rewriter.create<math::ExpOp>(loc, doubledX); in convertTanhOp()
44 divisor = rewriter.create<arith::AddFOp>(loc, exp2x, one); in convertTanhOp()
48 auto floatZero = rewriter.getFloatAttr(floatType, 0.0); in convertTanhOp()
67 auto leadingZeros = rewriter.create<arith::ConstantOp>( in convertCtlzOp()
86 Value inputNotZero = rewriter.create<arith::CmpIOp>( in convertCtlzOp()
88 rewriter.create<scf::ConditionOp>(loc, inputNotZero, in convertCtlzOp()
104 rewriter.create<scf::YieldOp>( in convertCtlzOp()
109 rewriter.setInsertionPointAfter(whileOp); in convertCtlzOp()
[all …]
/llvm-project-15.0.7/mlir/lib/Dialect/Arithmetic/Transforms/
H A DExpandOps.cpp19 PatternRewriter &rewriter) { in createConst() argument
20 return rewriter.create<arith::ConstantOp>( in createConst()
21 loc, rewriter.getIntegerAttr(type, value)); in createConst()
35 Value zero = createConst(loc, a.getType(), 0, rewriter); in matchAndRewrite()
38 Value one = createConst(loc, a.getType(), 1, rewriter); in matchAndRewrite()
58 Value plusOne = createConst(loc, type, 1, rewriter); in matchAndRewrite()
59 Value zero = createConst(loc, type, 0, rewriter); in matchAndRewrite()
60 Value minusOne = createConst(loc, type, -1, rewriter); in matchAndRewrite()
110 Value plusOne = createConst(loc, type, 1, rewriter); in matchAndRewrite()
111 Value zero = createConst(loc, type, 0, rewriter); in matchAndRewrite()
[all …]
/llvm-project-15.0.7/mlir/lib/Conversion/AffineToStandard/
H A DAffineToStandard.cpp107 rewriter.replaceOp(op, reduced); in matchAndRewrite()
123 rewriter.replaceOp(op, reduced); in matchAndRewrite()
158 rewriter.eraseBlock(scfForOp.getBody()); in matchAndRewrite()
208 rewriter.eraseBlock(parOp.getBody()); in matchAndRewrite()
231 parOp = rewriter.create<scf::ParallelOp>( in matchAndRewrite()
236 rewriter.eraseBlock(parOp.getBody()); in matchAndRewrite()
253 reductionOpValue, rewriter, loc, in matchAndRewrite()
315 rewriter.replaceOp(op, ifOp.getResults()); in matchAndRewrite()
333 rewriter.replaceOp(op, *maybeExpandedMap); in matchAndRewrite()
423 rewriter, op.getLoc(), op.getSrcMap(), in matchAndRewrite()
[all …]
/llvm-project-15.0.7/mlir/lib/Conversion/TosaToSCF/
H A DTosaToSCF.cpp27 rewriter.eraseBlock(&dstRegion.back()); in inlineIfCase()
34 rewriter.setInsertionPoint(yield); in inlineIfCase()
36 rewriter.eraseOp(yield); in inlineIfCase()
45 rewriter.eraseBlock(&dstRegion.back()); in inlineWhileCase()
50 rewriter.setInsertionPoint(yield); in inlineWhileCase()
57 rewriter.setInsertionPoint(yield); in inlineWhileCase()
60 rewriter.eraseOp(yield); in inlineWhileCase()
77 rewriter); in matchAndRewrite()
79 rewriter); in matchAndRewrite()
81 rewriter.replaceOp(op, newIf.getResults()); in matchAndRewrite()
[all …]
/llvm-project-15.0.7/mlir/lib/Conversion/NVGPUToNVVM/
H A DNVGPUToNVVM.cpp66 Type i32Ty = rewriter.getI32Type(); in convertIntrinsicResult()
67 Type f32Ty = rewriter.getF32Type(); in convertIntrinsicResult()
68 Type f64Ty = rewriter.getF64Type(); in convertIntrinsicResult()
144 Type i32Ty = rewriter.getI32Type(); in unpackOperandVector()
147 Type i8Ty = rewriter.getI8Type(); in unpackOperandVector()
165 rewriter.create<LLVM::BitcastOp>(loc, rewriter.getI32Type(), toUse)); in unpackOperandVector()
181 loc, rewriter.getI64Type(), rewriter.getI64IntegerAttr(idx)))); in unpackOperandVector()
252 rewriter.replaceOp(op, result); in matchAndRewrite()
397 rewriter.replaceOp(op, zero); in matchAndRewrite()
415 rewriter.replaceOp(op, zero); in matchAndRewrite()
[all …]
/llvm-project-15.0.7/mlir/lib/Dialect/Tosa/Transforms/
H A DTosaDecomposeTransposeConv.cpp130 conv2d = rewriter.create<tosa::Conv2DOp>( in matchAndRewrite()
132 rewriter.getI64ArrayAttr(convPad), rewriter.getI64ArrayAttr(stride), in matchAndRewrite()
135 conv2d = rewriter.create<tosa::Conv2DOp>( in matchAndRewrite()
137 rewriter.getI64ArrayAttr(convPad), rewriter.getI64ArrayAttr(stride), in matchAndRewrite()
138 rewriter.getI64ArrayAttr({1, 1})); in matchAndRewrite()
141 rewriter.replaceOp(op, conv2d); in matchAndRewrite()
249 rewriter.getI64IntegerAttr(1)); in matchAndRewrite()
252 rewriter.getI64IntegerAttr(2)); in matchAndRewrite()
280 auto zeroBias = rewriter.create<tosa::ConstOp>( in matchAndRewrite()
287 rewriter.getZeroAttr(biasETy))); in matchAndRewrite()
[all …]
/llvm-project-15.0.7/mlir/lib/Conversion/SPIRVToLLVM/
H A DSPIRVToLLVM.cpp216 rewriter.getIntegerAttr(rewriter.getI32Type(), value)); in createI32ConstantOf()
692 {rewriter.getIntegerAttr(rewriter.getI32Type(), 0)})); in matchAndRewrite()
701 {rewriter.getIntegerAttr(rewriter.getI32Type(), 1), in matchAndRewrite()
702 rewriter.getIntegerAttr(rewriter.getI32Type(), i)})); in matchAndRewrite()
705 rewriter.eraseOp(op); in matchAndRewrite()
962 rewriter.eraseOp(op); in matchAndRewrite()
1106 rewriter.eraseOp(op); in matchAndRewrite()
1336 rewriter.eraseOp(funcOp); in matchAndRewrite()
1359 rewriter.eraseOp(spvModuleOp); in matchAndRewrite()
1409 loc, llvmI32Type, rewriter.getIntegerAttr(rewriter.getI32Type(), i)); in matchAndRewrite()
[all …]
/llvm-project-15.0.7/mlir/lib/Conversion/AMDGPUToROCDL/
H A DAMDGPUToROCDL.cpp21 IntegerAttr valAttr = rewriter.getI32IntegerAttr(value); in createI32Constant()
22 Type llvmI32 = rewriter.getI32Type(); in createI32Constant()
58 Type i32 = rewriter.getI32Type(); in matchAndRewrite()
87 rewriter.getIntegerType(totalBits)); in matchAndRewrite()
139 rewriter, loc, in matchAndRewrite()
191 strideOp = rewriter.create<LLVM::MulOp>( in matchAndRewrite()
214 sgprOffset = rewriter.create<LLVM::AddOp>( in matchAndRewrite()
217 sgprOffset = rewriter.create<LLVM::AddOp>( in matchAndRewrite()
236 rewriter.replaceOp(gpuOp, replacement); in matchAndRewrite()
238 rewriter.eraseOp(gpuOp); in matchAndRewrite()
[all …]
/llvm-project-15.0.7/mlir/test/lib/Dialect/Test/
H A DTestPatterns.cpp61 return rewriter.getIntegerAttr(rewriter.getIntegerType(32), i); in opMTest()
96 rewriter, op->getLoc(), rewriter.getIntegerType(32), op->getOperand(0), in matchAndRewrite()
121 rewriter.replaceOpWithNewOp<TestCastOp>(op, rewriter.getI32Type(), in matchAndRewrite()
409 rewriter.eraseOp(op); in matchAndRewrite()
430 rewriter.create<ILLegalOpF>(op->getLoc(), rewriter.getIntegerType(32)); in matchAndRewrite()
434 rewriter.eraseOp(op); in matchAndRewrite()
486 rewriter.create<ILLegalOpF>(op->getLoc(), rewriter.getF32Type()); in matchAndRewrite()
504 rewriter.create<ILLegalOpF>(op->getLoc(), rewriter.getF32Type()); in matchAndRewrite()
585 rewriter.replaceOpWithNewOp<TestTypeProducerOp>(op, rewriter.getF32Type()); in matchAndRewrite()
598 rewriter.replaceOpWithNewOp<TestTypeProducerOp>(op, rewriter.getF64Type()); in matchAndRewrite()
[all …]
/llvm-project-15.0.7/mlir/lib/Dialect/SparseTensor/Transforms/
H A DSparseTensorConversion.cpp490 Value srcIdx = genAlloca(rewriter, loc, srcRank, rewriter.getIndexType()); in genSparse2SparseReshape()
491 Value dstIdx = genAlloca(rewriter, loc, dstRank, rewriter.getIndexType()); in genSparse2SparseReshape()
514 rewriter.replaceOp(op, dst); in genSparse2SparseReshape()
552 rewriter.replaceOp(op, genDimSizeCall(rewriter, op, enc, src, idx)); in matchAndRewrite()
614 rewriter.replaceOp(op, genNewCall(rewriter, op, params)); in matchAndRewrite()
650 rewriter.replaceOp(op, genNewCall(rewriter, op, params)); in matchAndRewrite()
707 rewriter.replaceOp(op, genNewCall(rewriter, op, params)); in matchAndRewrite()
753 Value ind = genAlloca(rewriter, loc, rank, rewriter.getIndexType()); in matchAndRewrite()
817 Value ind = genAlloca(rewriter, loc, rank, rewriter.getIndexType()); in matchAndRewrite()
886 rewriter.eraseOp(op); in matchAndRewrite()
[all …]
/llvm-project-15.0.7/mlir/lib/Dialect/Vector/Transforms/
H A DVectorDistribute.cpp33 rewriter.setInsertionPoint(warpOp); in rewriteWarpOpToScfFor()
50 rewriter.setInsertionPoint(ifOp); in rewriteWarpOpToScfFor()
55 rewriter.setInsertionPoint(ifOp); in rewriteWarpOpToScfFor()
130 rewriter.eraseOp(yieldOp); in rewriteWarpOpToScfFor()
162 rewriter.updateRootInPlace( in moveRegionToNewWarpOpAndReplaceReturns()
196 rewriter.replaceOp(warpOp, in moveRegionToNewWarpOpAndAppendReturns()
233 return rewriter.create(res); in cloneOpWithOperandsAndTypes()
298 rewriter.eraseOp(writeOp); in cloneWriteOp()
419 rewriter.eraseOp(writeOp); in tryExtractOp()
650 rewriter.eraseOp(warpOp); in matchAndRewrite()
[all …]
/llvm-project-15.0.7/mlir/lib/Conversion/MathToSPIRV/
H A DMathToSPIRV.cpp80 Type intType = rewriter.getIntegerType(bitwidth); in matchAndRewrite()
83 Value signMask = rewriter.create<spirv::ConstantOp>( in matchAndRewrite()
85 Value valueMask = rewriter.create<spirv::ConstantOp>( in matchAndRewrite()
107 Value value = rewriter.create<spirv::BitwiseAndOp>( in matchAndRewrite()
109 Value sign = rewriter.create<spirv::BitwiseAndOp>( in matchAndRewrite()
183 auto one = spirv::ConstantOp::getOne(type, loc, rewriter); in matchAndRewrite()
250 auto one = spirv::ConstantOp::getOne(ty, loc, rewriter); in matchAndRewrite()
253 half = rewriter.create<spirv::ConstantOp>( in matchAndRewrite()
258 half = rewriter.create<spirv::ConstantOp>( in matchAndRewrite()
259 loc, ty, rewriter.getFloatAttr(ety, 0.5)); in matchAndRewrite()
[all …]
/llvm-project-15.0.7/mlir/lib/Conversion/ComplexToStandard/
H A DComplexToStandard.cpp42 rewriter.replaceOpWithNewOp<math::SqrtOp>(op, sqNorm); in matchAndRewrite()
54 mlir::ImplicitLocOpBuilder b(op.getLoc(), rewriter); in matchAndRewrite()
133 mlir::ImplicitLocOpBuilder b(op.getLoc(), rewriter); in matchAndRewrite()
170 Value half = rewriter.create<arith::ConstantOp>( in matchAndRewrite()
172 Value exp = rewriter.create<math::ExpOp>(loc, imag); in matchAndRewrite()
289 Value zero = rewriter.create<arith::ConstantOp>( in matchAndRewrite()
306 Value inf = rewriter.create<arith::ConstantOp>( in matchAndRewrite()
308 rewriter.getFloatAttr( in matchAndRewrite()
334 Value one = rewriter.create<arith::ConstantOp>( in matchAndRewrite()
427 rewriter.replaceOpWithNewOp<complex::CreateOp>( in matchAndRewrite()
[all …]

12345678910>>...12