Skip to content

Commit 64d514a

Browse files
committed
[mlir] Fix -Wdeprecated-declarations of cast in VCIXToLLVMIRTranslation.cpp (NFC)
In file included from /llvm-project/mlir/lib/Target/LLVMIR/Dialect/VCIX/VCIXToLLVMIRTranslation.cpp:70: /llvm-project/build-Release/tools/mlir/include/mlir/Dialect/LLVMIR/VCIXConversions.inc:8:48: error: 'cast' is deprecated: Use mlir::cast<U>() instead [-Werror,-Wdeprecated-declarations] VectorType vt = op.getResult().getType().cast<VectorType>(); ^ /llvm-project/mlir/include/mlir/IR/Types.h:345:9: note: 'cast' has been explicitly marked deprecated here U Type::cast() const { ^ In file included from /llvm-project/mlir/lib/Target/LLVMIR/Dialect/VCIX/VCIXToLLVMIRTranslation.cpp:70: /llvm-project/build-Release/tools/mlir/include/mlir/Dialect/LLVMIR/VCIXConversions.inc:8:48: error: 'cast<mlir::VectorType>' is deprecated: Use mlir::cast<U>() instead [-Werror,-Wdeprecated-declarations] VectorType vt = op.getResult().getType().cast<VectorType>(); ^ /llvm-project/mlir/include/mlir/IR/Types.h:112:5: note: 'cast<mlir::VectorType>' has been explicitly marked deprecated here [[deprecated("Use mlir::cast<U>() instead")]] ^ In file included from /llvm-project/mlir/lib/Target/LLVMIR/Dialect/VCIX/VCIXToLLVMIRTranslation.cpp:70: /llvm-project/build-Release/tools/mlir/include/mlir/Dialect/LLVMIR/VCIXConversions.inc:32:48: error: 'cast' is deprecated: Use mlir::cast<U>() instead [-Werror,-Wdeprecated-declarations] VectorType vt = op.getResult().getType().cast<VectorType>(); ^ /llvm-project/mlir/include/mlir/IR/Types.h:345:9: note: 'cast' has been explicitly marked deprecated here U Type::cast() const { ^ In file included from /llvm-project/mlir/lib/Target/LLVMIR/Dialect/VCIX/VCIXToLLVMIRTranslation.cpp:70: /llvm-project/build-Release/tools/mlir/include/mlir/Dialect/LLVMIR/VCIXConversions.inc:32:48: error: 'cast<mlir::VectorType>' is deprecated: Use mlir::cast<U>() instead [-Werror,-Wdeprecated-declarations] VectorType vt = op.getResult().getType().cast<VectorType>(); ^ /llvm-project/mlir/include/mlir/IR/Types.h:112:5: note: 'cast<mlir::VectorType>' has been explicitly marked deprecated here [[deprecated("Use mlir::cast<U>() instead")]] ^ 4 errors generated.
1 parent 2d09ac4 commit 64d514a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

mlir/include/mlir/Dialect/LLVMIR/VCIXOps.td

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def VCIX_BinaryImmOp : VCIX_Op<"v.iv">,
7878
xlen, $opcode, $_location, moduleTranslation);
7979
llvm::Value *immConst = mlir::LLVM::detail::getLLVMConstant(
8080
xlen, $imm, $_location, moduleTranslation);
81-
VectorType vt = op.getResult().getType().cast<VectorType>();
81+
VectorType vt = mlir::cast<VectorType>(op.getResult().getType());
8282
llvm::Value *vl =
8383
createVL(builder, $vl, vt, xlen, $_location, moduleTranslation);
8484
$res = createIntrinsicCall(
@@ -120,7 +120,7 @@ def VCIX_BinaryOp : VCIX_Op<"v.sv">,
120120
} else {
121121
id = llvm::Intrinsic::riscv_sf_vc_v_fv_se;
122122
}
123-
VectorType vt = op.getResult().getType().cast<VectorType>();
123+
VectorType vt = mlir::cast<VectorType>(op.getResult().getType());
124124
llvm::Value *vl =
125125
createVL(builder, $vl, vt, xlen, $_location, moduleTranslation);
126126
$res = createIntrinsicCall(

0 commit comments

Comments
 (0)