/external/tensorflow/tensorflow/compiler/mlir/lite/transforms/ |
D | optimize.cc | 316 if (!matchPattern(constant_val, m_Constant(&added_value))) return failure(); in matchAndRewrite() 344 if (!is_none_bias && !matchPattern(bias, m_Constant(&bias_value))) in matchAndRewrite() 447 if (!matchPattern(constant_val, m_Constant(&cst))) return failure(); in matchAndRewrite() 456 if (!matchPattern(filter, m_Constant(&cst_tmp))) return failure(); in matchAndRewrite() 458 !matchPattern(bias, m_Constant(&cst_tmp))) in matchAndRewrite() 544 if (!matchPattern(gamma, m_Constant(&gamma_cst))) return failure(); in matchAndRewrite() 564 if (!matchPattern(filter, m_Constant(&cst_tmp))) return failure(); in matchAndRewrite() 566 !matchPattern(bias, m_Constant(&cst_tmp))) in matchAndRewrite() 628 if (!matchPattern(binary_op->getOperand(1), m_Constant(&cst))) in matchAndRewrite() 637 if (!matchPattern(filter, m_Constant(&filter_cst))) { in matchAndRewrite() [all …]
|
D | dilated_conv.h | 239 if (matchPattern(stb_paddings, m_Constant(&stb_paddings_attr)) && in matchAndRewrite() 240 matchPattern(bts_crops, m_Constant(&bts_crops_attr))) { in matchAndRewrite() 313 if (!matchPattern(stb_block_shape, m_Constant(&stb_bs_attr)) || in ExtractDilationsAttrFromBlockShape() 314 !matchPattern(bts_block_shape, m_Constant(&bts_bs_attr))) { in ExtractDilationsAttrFromBlockShape()
|
D | split_merged_operands.cc | 90 if (!matchPattern(input_op, m_Constant(&attr))) { in DuplicateValueIfNeeded()
|
D | legalize_tf.cc | 228 if (!matchPattern(tf_concat_op.axis(), m_Constant(&axis))) return failure(); in matchAndRewrite() 400 if (!matchPattern(tf_matrix_diag_v2_or_v3_op.k(), m_Constant(&k))) in ConvertTFMatrixDiagV2orV3() 407 m_Constant(&num_rows))) in ConvertTFMatrixDiagV2orV3() 414 m_Constant(&num_cols))) in ConvertTFMatrixDiagV2orV3() 421 m_Constant(&padding_value))) in ConvertTFMatrixDiagV2orV3()
|
D | prepare_tf.cc | 123 if (!matchPattern(min, m_Constant(&min_value))) { in operator ()() 126 if (!matchPattern(max, m_Constant(&max_value))) { in operator ()() 607 !matchPattern(begin, m_Constant(&begin_dense_elem_attr))) { in RewriteEllipsisMask() 615 !matchPattern(end, m_Constant(&end_dense_elem_attr))) { in RewriteEllipsisMask() 624 !matchPattern(stride, m_Constant(&stride_dense_elem_attr))) { in RewriteEllipsisMask() 779 !matchPattern(begin_attr, m_Constant(&begin_elem_attr))) { in matchAndRewrite() 782 if (!end_attr_type || !matchPattern(end_attr, m_Constant(&end_elem_attr))) { in matchAndRewrite() 786 !matchPattern(strides_attr, m_Constant(&strides_elem_attr))) { in matchAndRewrite()
|
/external/tensorflow/tensorflow/compiler/mlir/tensorflow/ir/ |
D | tf_ops_n_z.cc | 134 if (matchPattern(op.depth(), m_Constant(&depth_attr))) { in Verify() 161 if (matchPattern(depth, m_Constant(&depth_attr)) && in InferOneHotOpType() 501 if (matchPattern(start, m_Constant(&start_val)) && in build() 502 matchPattern(limit, m_Constant(&limit_val)) && in build() 503 matchPattern(delta, m_Constant(&delta_val))) { in build() 591 if (!matchPattern(shape, m_Constant(&shape_attr))) { in GetReshapeOutputType() 1099 if (matchPattern(op.begin(), m_Constant(&begin_indices))) { in Verify() 1102 matchPattern(op.size(), m_Constant(&slice_sizes)); in Verify() 1134 if (matchPattern(op.size(), m_Constant(&slice_sizes))) { in Verify() 1243 if (matchPattern(op.block_shape(), m_Constant(&block_shape_attr))) { in Verify() [all …]
|
/external/llvm-project/mlir/lib/Transforms/Utils/ |
D | FoldUtils.cpp | 60 assert(matchPattern(constOp, m_Constant())); in materializeConstant() 123 matchPattern(op, m_Constant(&constValue)); in notifyRemoval() 176 [&](OpOperand &O) { return !matchPattern(O.get(), m_Constant()); }); in tryToFold() 183 matchPattern(op->getOperand(i), m_Constant(&operandConstants[i])); in tryToFold()
|
/external/swiftshader/third_party/llvm-10.0/llvm/lib/Transforms/InstCombine/ |
D | InstCombineMulDivRem.cpp | 199 if (match(&I, m_Mul(m_Shl(m_Value(NewOp), m_Constant(C2)), in visitMul() 200 m_Constant(C1))) && in visitMul() 214 if (match(&I, m_Mul(m_Value(NewOp), m_Constant(C1)))) { in visitMul() 268 if (match(Op0, m_OneUse(m_Add(m_Value(X), m_Constant(C1))))) { in visitMul() 280 if (match(Op0, m_Neg(m_Value(X))) && match(Op1, m_Constant(Op1C))) in visitMul() 423 if (match(Op0, m_FNeg(m_Value(X))) && match(Op1, m_Constant(C))) in visitFMul() 437 if (match(Op1, m_Constant(C)) && C->isFiniteNonZeroFP()) { in visitFMul() 439 if (match(Op0, m_OneUse(m_FDiv(m_Constant(C1), m_Value(X))))) { in visitFMul() 445 if (match(Op0, m_FDiv(m_Value(X), m_Constant(C1)))) { in visitFMul() 461 if (match(Op0, m_OneUse(m_FAdd(m_Value(X), m_Constant(C1))))) { in visitFMul() [all …]
|
D | InstCombineAddSub.cpp | 831 if (!match(Op1, m_Constant(Op1C))) in foldNoWrapAdd() 849 if (match(Op0, m_OneUse(m_SExt(m_NSWAdd(m_Value(X), m_Constant(NarrowC)))))) { in foldNoWrapAdd() 856 if (match(Op0, m_OneUse(m_ZExt(m_NUWAdd(m_Value(X), m_Constant(NarrowC)))))) { in foldNoWrapAdd() 869 if (!match(Op1, m_Constant(Op1C))) in foldAddWithConstant() 879 if (match(Op0, m_Sub(m_Constant(Op00C), m_Value(X)))) in foldAddWithConstant() 1142 m_ZExtOrSelf(m_Sub(m_Constant(C), m_ZExtOrSelf(m_Value(NBits))))) || in canonicalizeCondSignextOfHighBitExtractToSignextHighBitExtract() 1186 m_Shl(m_Constant(SignExtendingValueBaseConstant), in canonicalizeCondSignextOfHighBitExtractToSignextHighBitExtract() 1771 if (match(Op1, m_Sub(m_Constant(C2), m_Value(X)))) in visitSub() 1775 if (match(Op1, m_Add(m_Value(X), m_Constant(C2)))) in visitSub() 1904 if (match(Op0, m_OneUse(m_And(m_Specific(Op1), m_Constant(C))))) { in visitSub() [all …]
|
D | InstCombineVectorOps.cpp | 918 match(InsElt2.getOperand(1), m_Constant(ScalarC)) && in hoistInsEltConst() 940 if (!match(Shuf->getOperand(1), m_Constant(ShufConstVec)) || in foldConstantInsEltIntoShuffle() 941 !match(InsElt.getOperand(1), m_Constant(InsEltScalar)) || in foldConstantInsEltIntoShuffle() 990 !match(InsElt.getOperand(1), m_Constant(Val[0])) || in foldConstantInsEltIntoShuffle() 992 !match(IEI->getOperand(1), m_Constant(Val[1]))) in foldConstantInsEltIntoShuffle() 1436 if (match(BO1, m_Constant(C))) { in getAlternateBinop() 1463 if (match(Op0, m_BinOp(m_Specific(Op1), m_Constant(C)))) in foldSelectShuffleWith1Binop() 1465 else if (match(Op1, m_BinOp(m_Specific(Op0), m_Constant(C)))) in foldSelectShuffleWith1Binop() 1571 if (match(B0, m_BinOp(m_Value(X), m_Constant(C0))) && in foldSelectShuffle() 1572 match(B1, m_BinOp(m_Value(Y), m_Constant(C1)))) in foldSelectShuffle() [all …]
|
D | InstCombineShifts.cpp | 396 if (match(Op0, m_Constant()) && match(Op1, m_Add(m_Value(A), m_Constant(C)))) in commonShiftTransforms() 1020 if (match(Op1, m_Constant(C1))) { in visitShl() 1024 if (match(Op0, m_OneUse(m_Shl(m_Constant(C2), m_Value(X))))) in visitShl() 1028 if (match(Op0, m_Mul(m_Value(X), m_Constant(C2)))) in visitShl() 1197 m_ZExtOrSelf(m_Sub(m_Constant(C1), in foldVariableSignZeroExtensionOfVariableHighBitExtract() 1199 m_ZExtOrSelf(m_Sub(m_Constant(C2), in foldVariableSignZeroExtensionOfVariableHighBitExtract() 1218 m_Sub(m_Constant(C0), m_ZExtOrSelf(m_Specific(NBits))))) || in foldVariableSignZeroExtensionOfVariableHighBitExtract()
|
/external/llvm-project/llvm/lib/Transforms/InstCombine/ |
D | InstCombineMulDivRem.cpp | 170 if (match(&I, m_Mul(m_Shl(m_Value(NewOp), m_Constant(C2)), in visitMul() 171 m_Constant(C1))) && in visitMul() 185 if (match(&I, m_Mul(m_Value(NewOp), m_Constant(C1)))) { in visitMul() 222 if (match(Op0, m_OneUse(m_Add(m_Value(X), m_Constant(C1))))) { in visitMul() 246 if (match(Op0, m_Neg(m_Value(X))) && match(Op1, m_Constant(Op1C))) in visitMul() 442 if (match(Op0, m_FNeg(m_Value(X))) && match(Op1, m_Constant(C))) in visitFMul() 452 if (match(Op1, m_Constant(C)) && C->isFiniteNonZeroFP()) { in visitFMul() 454 if (match(Op0, m_OneUse(m_FDiv(m_Constant(C1), m_Value(X))))) { in visitFMul() 460 if (match(Op0, m_FDiv(m_Value(X), m_Constant(C1)))) { in visitFMul() 476 if (match(Op0, m_OneUse(m_FAdd(m_Value(X), m_Constant(C1))))) { in visitFMul() [all …]
|
D | InstCombineShifts.cpp | 332 if (!match(I.getOperand(1), m_Constant(C1))) in foldShiftOfShiftedLogic() 346 match(V, m_OneUse(m_Shift(m_Value(X), m_Constant(C0)))) && in foldShiftOfShiftedLogic() 399 if (match(Op0, m_Constant()) && match(Op1, m_Add(m_Value(A), m_Constant(C)))) in commonShiftTransforms() 408 if (Op1->hasOneUse() && match(Op1, m_SRem(m_Value(A), m_Constant(C))) && in commonShiftTransforms() 1005 if (match(Op1, m_Constant(C1))) { in visitShl() 1009 if (match(Op0, m_OneUse(m_Shl(m_Constant(C2), m_Value(X))))) in visitShl() 1013 if (match(Op0, m_Mul(m_Value(X), m_Constant(C2)))) in visitShl() 1188 m_ZExtOrSelf(m_Sub(m_Constant(C1), in foldVariableSignZeroExtensionOfVariableHighBitExtract() 1190 m_ZExtOrSelf(m_Sub(m_Constant(C2), in foldVariableSignZeroExtensionOfVariableHighBitExtract() 1209 m_Sub(m_Constant(C0), m_ZExtOrSelf(m_Specific(NBits))))) || in foldVariableSignZeroExtensionOfVariableHighBitExtract()
|
D | InstCombineAddSub.cpp | 828 if (!match(Op1, m_Constant(Op1C))) in foldNoWrapAdd() 846 if (match(Op0, m_OneUse(m_SExt(m_NSWAdd(m_Value(X), m_Constant(NarrowC)))))) { in foldNoWrapAdd() 853 if (match(Op0, m_OneUse(m_ZExt(m_NUWAdd(m_Value(X), m_Constant(NarrowC)))))) { in foldNoWrapAdd() 866 if (!match(Op1, m_Constant(Op1C))) in foldAddWithConstant() 876 if (match(Op0, m_Sub(m_Constant(Op00C), m_Value(X)))) in foldAddWithConstant() 1180 m_ZExtOrSelf(m_Sub(m_Constant(C), m_ZExtOrSelf(m_Value(NBits))))) || in canonicalizeCondSignextOfHighBitExtractToSignextHighBitExtract() 1224 m_Shl(m_Constant(SignExtendingValueBaseConstant), in canonicalizeCondSignextOfHighBitExtractToSignextHighBitExtract() 1733 if (match(Op1, m_Add(m_Value(X), m_Constant(C2)))) in visitSub() 1843 if (match(Op1, m_Sub(m_Constant(C2), m_Value(X))) && !isa<ConstantExpr>(C2)) in visitSub() 1922 if (match(Op0, m_OneUse(m_And(m_Specific(Op1), m_Constant(C))))) { in visitSub() [all …]
|
/external/tensorflow/tensorflow/compiler/mlir/lite/quantization/tensorflow/ |
D | tf_to_quant.cc | 98 if (!matchPattern(min, m_Constant(&min_value))) return failure(); in matchAndRewrite() 99 if (!matchPattern(max, m_Constant(&max_value))) return failure(); in matchAndRewrite()
|
/external/tensorflow/tensorflow/compiler/mlir/tosa/transforms/ |
D | legalize_tf.cc | 474 if (!matchPattern(tf_argmax_op.dimension(), m_Constant(&axis_elems))) in matchAndRewrite() 639 if (!matchPattern(tf_concatv2_op.axis(), m_Constant(&axis_elems))) in matchAndRewrite() 776 if (!matchPattern(tf_fill_op.dims(), m_Constant(&dims_elems))) in matchAndRewrite() 786 if (!matchPattern(tf_fill_op.value(), m_Constant(&value_elem))) in matchAndRewrite() 1006 m_Constant(&output_shape_elems))) { in matchAndRewrite() 1039 if (!matchPattern(tf_all_op.reduction_indices(), m_Constant(&axes_elems))) in matchAndRewrite() 1065 if (!matchPattern(tf_any_op.reduction_indices(), m_Constant(&axes_elems))) in matchAndRewrite() 1091 if (!matchPattern(tf_max_op.reduction_indices(), m_Constant(&axes_elems))) in matchAndRewrite() 1117 if (!matchPattern(tf_min_op.reduction_indices(), m_Constant(&axes_elems))) in matchAndRewrite() 1143 if (!matchPattern(tf_mean_op.reduction_indices(), m_Constant(&axes_elems))) in matchAndRewrite() [all …]
|
/external/llvm-project/mlir/test/lib/IR/ |
D | TestMatchers.cpp | 129 auto p = m_Op<MulFOp>(a, m_Op<AddFOp>(a, m_Constant(&floatAttr))); in test2() 130 auto p1 = m_Op<MulFOp>(a, m_Op<AddFOp>(a, m_Constant())); in test2()
|
/external/llvm-project/llvm/lib/Transforms/Vectorize/ |
D | VectorCombine.cpp | 525 if (!match(Ins0, m_InsertElt(m_Constant(VecC0), m_Value(V0), in scalarizeBinopOrCmp() 527 !match(Ins0, m_Constant(VecC0))) in scalarizeBinopOrCmp() 529 if (!match(Ins1, m_InsertElt(m_Constant(VecC1), m_Value(V1), in scalarizeBinopOrCmp() 531 !match(Ins1, m_Constant(VecC1))) in scalarizeBinopOrCmp() 630 if (!match(B0, m_OneUse(m_Cmp(P0, m_Instruction(I0), m_Constant(C0)))) || in foldExtractedCmps() 631 !match(B1, m_OneUse(m_Cmp(P1, m_Instruction(I1), m_Constant(C1)))) || in foldExtractedCmps()
|
/external/tensorflow/tensorflow/compiler/mlir/xla/transforms/ |
D | prepare_for_export.cc | 50 if (!matchPattern(op, m_Constant(&attr))) return; in runOnFunction()
|
/external/tensorflow/tensorflow/compiler/mlir/tfr/ir/ |
D | tfr_ops.cc | 369 if (matchPattern(cst_tensor_op.arg(), m_Constant(&array))) { in matchAndRewrite() 388 if (matchPattern(cst_tensor_op.arg(), m_Constant(&scalar))) { in matchAndRewrite() 457 if (!matchPattern(ge_op.index(), m_Constant(&index))) { in matchAndRewrite() 503 if (!matchPattern(operand, m_Constant(&array_elt))) { in matchAndRewrite()
|
/external/tensorflow/tensorflow/compiler/mlir/lite/ir/ |
D | tfl_ops.cc | 153 if (!matchPattern(value, m_Constant(&constant)) || !constant.isSplat()) { in EqualsZero() 851 if (!matchPattern(input(), m_Constant(&input_tensor)) || in fold() 852 !matchPattern(filter(), m_Constant(&weights_tensor)) || in fold() 853 (has_bias && !matchPattern(bias(), m_Constant(&bias_tensor)))) { in fold() 1077 if (matchPattern(shape, m_Constant(&shape_value))) { in Verify() 1286 if (!matchPattern(reshape.shape(), m_Constant(&shape))) { in matchAndRewrite() 1363 if (!matchPattern(shape, m_Constant(&shape_attr))) { in GetReshapeOutputType() 1555 if (matchPattern(op.begin(), m_Constant(&begin))) { in Verify() 1567 if (matchPattern(op.size(), m_Constant(&size))) { in Verify() 1606 if (!matchPattern(input_op, m_Constant(&attr))) { in NarrowDownInt64InputValuesForOp() [all …]
|
/external/tensorflow/tensorflow/compiler/mlir/tensorflow/utils/ |
D | attribute_utils.h | 64 return matchPattern(val, m_Constant(&attr)); in GetValueAsConstant()
|
/external/tensorflow/tensorflow/compiler/mlir/tensorflow/transforms/ |
D | init_text_file_to_import_test_pass.cc | 73 if (!matchPattern(op.getOperation(), m_Constant(&attr))) { in runOnOperation()
|
/external/llvm-project/mlir/include/mlir/IR/ |
D | Matchers.h | 210 inline detail::constant_op_matcher m_Constant() { in m_Constant() function 217 inline detail::constant_op_binder<AttrT> m_Constant(AttrT *bind_value) { in m_Constant() function
|
/external/llvm-project/mlir/lib/Dialect/Quant/Transforms/ |
D | ConvertConst.cpp | 45 if (!matchPattern(qbarrier.arg(), m_Constant(&value))) { in matchAndRewrite()
|