Skip to content

Commit 6113875

Browse files
committed
Fix formatting issues
1 parent b77006f commit 6113875

File tree

1 file changed

+14
-11
lines changed

1 file changed

+14
-11
lines changed

mlir/lib/Dialect/Vector/IR/VectorOps.cpp

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ std::optional<int64_t> vector::getConstantVscaleMultiplier(Value value) {
397397
}
398398

399399
/// 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
401401
/// than the target element type.
402402
static IntegerAttr convertIntegerAttr(IntegerAttr intAttr, Type expectedType) {
403403
if (intAttr.getType() == expectedType)
@@ -2462,9 +2462,9 @@ static OpFoldResult foldFromElementsToElements(FromElementsOp fromElementsOp) {
24622462
static OpFoldResult foldFromElementsToConstant(FromElementsOp fromElementsOp,
24632463
ArrayRef<Attribute> elements) {
24642464
// 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+
}))
24682468
return {};
24692469

24702470
// DenseElementsAttr only supports int/index/float/complex types.
@@ -2473,13 +2473,16 @@ static OpFoldResult foldFromElementsToConstant(FromElementsOp fromElementsOp,
24732473
if (!destEltType.isIntOrIndexOrFloat() && !isa<ComplexType>(destEltType))
24742474
return {};
24752475

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+
});
24832486

24842487
return DenseElementsAttr::get(destVecType, convertedElements);
24852488
}

0 commit comments

Comments
 (0)