[Mlir-commits] [mlir] [mlir][LLVM] Delete `getVectorElementType` (PR #134981)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Wed Apr 9 02:42:14 PDT 2025
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff HEAD~1 HEAD --extensions cpp,h -- mlir/include/mlir/Dialect/LLVMIR/LLVMTypes.h mlir/lib/Conversion/SPIRVToLLVM/SPIRVToLLVM.cpp mlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp mlir/lib/Dialect/LLVMIR/IR/LLVMTypes.cpp mlir/lib/Target/LLVMIR/ModuleImport.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/mlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp b/mlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp
index 7b01bab35..33a168654 100644
--- a/mlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp
+++ b/mlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp
@@ -2734,9 +2734,9 @@ void ShuffleVectorOp::build(OpBuilder &builder, OperationState &state, Value v1,
Value v2, DenseI32ArrayAttr mask,
ArrayRef<NamedAttribute> attrs) {
auto containerType = v1.getType();
- auto vType = LLVM::getVectorType(cast<VectorType>(containerType).getElementType(),
- mask.size(),
- LLVM::isScalableVectorType(containerType));
+ auto vType = LLVM::getVectorType(
+ cast<VectorType>(containerType).getElementType(), mask.size(),
+ LLVM::isScalableVectorType(containerType));
build(builder, state, vType, v1, v2, mask);
state.addAttributes(attrs);
}
@@ -2752,8 +2752,9 @@ static ParseResult parseShuffleType(AsmParser &parser, Type v1Type,
if (!LLVM::isCompatibleVectorType(v1Type))
return parser.emitError(parser.getCurrentLocation(),
"expected an LLVM compatible vector type");
- resType = LLVM::getVectorType(cast<VectorType>(v1Type).getElementType(), mask.size(),
- LLVM::isScalableVectorType(v1Type));
+ resType =
+ LLVM::getVectorType(cast<VectorType>(v1Type).getElementType(),
+ mask.size(), LLVM::isScalableVectorType(v1Type));
return success();
}
@@ -3423,9 +3424,10 @@ static LogicalResult verifyExtOp(ExtOp op) {
return op.emitError("input and output vectors are of incompatible shape");
// Because this is a CastOp, the element of vectors is guaranteed to be an
// integer.
- inputType = cast<IntegerType>(cast<VectorType>(op.getArg().getType()).getElementType());
- outputType =
- cast<IntegerType>(cast<VectorType>(op.getResult().getType()).getElementType());
+ inputType = cast<IntegerType>(
+ cast<VectorType>(op.getArg().getType()).getElementType());
+ outputType = cast<IntegerType>(
+ cast<VectorType>(op.getResult().getType()).getElementType());
} else {
// Because this is a CastOp and arg is not a vector, arg is guaranteed to be
// an integer.
diff --git a/mlir/lib/Target/LLVMIR/ModuleImport.cpp b/mlir/lib/Target/LLVMIR/ModuleImport.cpp
index 0d08f15d2..187f1bdf7 100644
--- a/mlir/lib/Target/LLVMIR/ModuleImport.cpp
+++ b/mlir/lib/Target/LLVMIR/ModuleImport.cpp
@@ -139,8 +139,8 @@ static LogicalResult convertInstructionImpl(OpBuilder &odsBuilder,
if (iface.isConvertibleInstruction(inst->getOpcode()))
return iface.convertInstruction(odsBuilder, inst, llvmOperands,
moduleImport);
- // TODO: Implement the `convertInstruction` hooks in the
- // `LLVMDialectLLVMIRImportInterface` and move the following include there.
+ // TODO: Implement the `convertInstruction` hooks in the
+ // `LLVMDialectLLVMIRImportInterface` and move the following include there.
#include "mlir/Dialect/LLVMIR/LLVMOpFromLLVMIRConversions.inc"
return failure();
}
``````````
</details>
https://github.com/llvm/llvm-project/pull/134981
More information about the Mlir-commits
mailing list