Lines Matching defs:srcAttr
42 /// Converts the given `srcAttr` into a boolean attribute if it holds an
44 static BoolAttr convertBoolAttr(Attribute srcAttr, Builder builder) {
45 if (auto boolAttr = dyn_cast<BoolAttr>(srcAttr))
47 if (auto intAttr = dyn_cast<IntegerAttr>(srcAttr))
52 /// Converts the given `srcAttr` to a new attribute of the given `dstType`.
54 static IntegerAttr convertIntegerAttr(IntegerAttr srcAttr, IntegerType dstType,
58 if (srcAttr.getValue().isIntN(dstType.getWidth()))
59 return builder.getIntegerAttr(dstType, srcAttr.getInt());
66 if (srcAttr.getValue().isSignedIntN(dstType.getWidth())) {
67 auto dstAttr = builder.getIntegerAttr(dstType, srcAttr.getInt());
68 LLVM_DEBUG(llvm::dbgs() << "attribute '" << srcAttr << "' converted to '"
73 LLVM_DEBUG(llvm::dbgs() << "attribute '" << srcAttr
79 /// Converts the given `srcAttr` to a new attribute of the given `dstType`.
81 static FloatAttr convertFloatAttr(FloatAttr srcAttr, FloatType dstType,
88 APFloat dstVal = srcAttr.getValue();
94 << srcAttr << " illegal: cannot fit into converted type '"
298 for (FloatAttr srcAttr : dstElementsAttr.getValues<FloatAttr>()) {
300 convertFloatAttr(srcAttr, cast<FloatType>(dstElemType), rewriter);
308 for (IntegerAttr srcAttr : dstElementsAttr.getValues<IntegerAttr>()) {
310 srcAttr, cast<IntegerType>(dstElemType), rewriter);
363 auto srcAttr = cast<FloatAttr>(cstAttr);
364 auto dstAttr = srcAttr;
369 dstAttr = convertFloatAttr(srcAttr, cast<FloatType>(dstType), rewriter);
391 auto srcAttr = cast<IntegerAttr>(cstAttr);
393 convertIntegerAttr(srcAttr, cast<IntegerType>(dstType), rewriter);