Lines Matching refs:srcAttr
42 static BoolAttr convertBoolAttr(Attribute srcAttr, Builder builder) { in convertBoolAttr() argument
43 if (auto boolAttr = srcAttr.dyn_cast<BoolAttr>()) in convertBoolAttr()
45 if (auto intAttr = srcAttr.dyn_cast<IntegerAttr>()) in convertBoolAttr()
52 static IntegerAttr convertIntegerAttr(IntegerAttr srcAttr, IntegerType dstType, in convertIntegerAttr() argument
56 if (srcAttr.getValue().isIntN(dstType.getWidth())) in convertIntegerAttr()
57 return builder.getIntegerAttr(dstType, srcAttr.getInt()); in convertIntegerAttr()
64 if (srcAttr.getValue().isSignedIntN(dstType.getWidth())) { in convertIntegerAttr()
65 auto dstAttr = builder.getIntegerAttr(dstType, srcAttr.getInt()); in convertIntegerAttr()
66 LLVM_DEBUG(llvm::dbgs() << "attribute '" << srcAttr << "' converted to '" in convertIntegerAttr()
71 LLVM_DEBUG(llvm::dbgs() << "attribute '" << srcAttr in convertIntegerAttr()
79 static FloatAttr convertFloatAttr(FloatAttr srcAttr, FloatType dstType, in convertFloatAttr() argument
86 APFloat dstVal = srcAttr.getValue(); in convertFloatAttr()
92 << srcAttr << " illegal: cannot fit into converted type '" in convertFloatAttr()
629 for (Attribute srcAttr : dstElementsAttr.getAttributeValues()) { in matchAndRewrite() local
631 srcAttr.cast<FloatAttr>(), dstElemType.cast<FloatType>(), rewriter); in matchAndRewrite()
639 for (Attribute srcAttr : dstElementsAttr.getAttributeValues()) { in matchAndRewrite() local
641 convertIntegerAttr(srcAttr.cast<IntegerAttr>(), in matchAndRewrite()
683 auto srcAttr = constOp.value().cast<FloatAttr>(); in matchAndRewrite() local
684 auto dstAttr = srcAttr; in matchAndRewrite()
689 dstAttr = convertFloatAttr(srcAttr, dstType.cast<FloatType>(), rewriter); in matchAndRewrite()
711 auto srcAttr = constOp.value().cast<IntegerAttr>(); in matchAndRewrite() local
713 convertIntegerAttr(srcAttr, dstType.cast<IntegerType>(), rewriter); in matchAndRewrite()