@@ -397,7 +397,7 @@ std::optional<int64_t> vector::getConstantVscaleMultiplier(Value value) {
397
397
}
398
398
399
399
// / Converts an IntegerAttr to have the specified type if needed.
400
- // / This handles cases where integer constant attributes have a different type
400
+ // / This handles cases where integer constant attributes have a different type
401
401
// / than the target element type.
402
402
static IntegerAttr convertIntegerAttr (IntegerAttr intAttr, Type expectedType) {
403
403
if (intAttr.getType () == expectedType)
@@ -2462,9 +2462,9 @@ static OpFoldResult foldFromElementsToElements(FromElementsOp fromElementsOp) {
2462
2462
static OpFoldResult foldFromElementsToConstant (FromElementsOp fromElementsOp,
2463
2463
ArrayRef<Attribute> elements) {
2464
2464
// Check for null or poison attributes before any processing.
2465
- if (llvm::any_of (elements, [](Attribute attr) {
2466
- return !attr || isa<ub::PoisonAttrInterface>(attr);
2467
- }))
2465
+ if (llvm::any_of (elements, [](Attribute attr) {
2466
+ return !attr || isa<ub::PoisonAttrInterface>(attr);
2467
+ }))
2468
2468
return {};
2469
2469
2470
2470
// DenseElementsAttr only supports int/index/float/complex types.
@@ -2473,13 +2473,16 @@ static OpFoldResult foldFromElementsToConstant(FromElementsOp fromElementsOp,
2473
2473
if (!destEltType.isIntOrIndexOrFloat () && !isa<ComplexType>(destEltType))
2474
2474
return {};
2475
2475
2476
- // Convert integer attributes to the target type if needed, leave others unchanged.
2477
- auto convertedElements = llvm::map_to_vector (elements, [&](Attribute attr) -> Attribute {
2478
- if (auto intAttr = dyn_cast<IntegerAttr>(attr)) {
2479
- return convertIntegerAttr (intAttr, destEltType);
2480
- }
2481
- return attr; // Non-integer attributes (FloatAttr, etc.) returned unchanged
2482
- });
2476
+ // Convert integer attributes to the target type if needed, leave others
2477
+ // unchanged.
2478
+ auto convertedElements =
2479
+ llvm::map_to_vector (elements, [&](Attribute attr) -> Attribute {
2480
+ if (auto intAttr = dyn_cast<IntegerAttr>(attr)) {
2481
+ return convertIntegerAttr (intAttr, destEltType);
2482
+ }
2483
+ return attr; // Non-integer attributes (FloatAttr, etc.) returned
2484
+ // unchanged
2485
+ });
2483
2486
2484
2487
return DenseElementsAttr::get (destVecType, convertedElements);
2485
2488
}
0 commit comments