[Mlir-commits] [mlir] [MLIR][NFC]Fix unusued variable warning. (PR #97813)

Mats Petersson llvmlistbot at llvm.org
Fri Jul 5 04:30:32 PDT 2024


https://github.com/Leporacanthicus created https://github.com/llvm/llvm-project/pull/97813

This just changes a dyn_cast to and isa call to check for type, which avoids getting a warning in clang. The variable `ity` is not used in the next block.

No functional change.

>From 0b2807276eb6b726f9a8c97cd6d7eb3608b6dda2 Mon Sep 17 00:00:00 2001
From: Mats Petersson <mats.petersson at arm.com>
Date: Fri, 5 Jul 2024 12:04:47 +0100
Subject: [PATCH] [MLIR][NFC]Fix unusued variable warning.

This just changes a dyn_cast to and isa call to check for type,
which avoids getting a warning in clang. The variable `ity` is not
used in the next block.

No functional change.
---
 mlir/lib/Target/LLVMIR/ModuleTranslation.cpp | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/mlir/lib/Target/LLVMIR/ModuleTranslation.cpp b/mlir/lib/Target/LLVMIR/ModuleTranslation.cpp
index e0b1816e2dcfb..c4a4ba529ee22 100644
--- a/mlir/lib/Target/LLVMIR/ModuleTranslation.cpp
+++ b/mlir/lib/Target/LLVMIR/ModuleTranslation.cpp
@@ -639,8 +639,7 @@ llvm::Constant *mlir::LLVM::detail::getLLVMConstant(
         if (llvm::ConstantDataSequential::isElementTypeCompatible(
                 elementType)) {
           // TODO: Handle all compatible types. This code only handles integer.
-          if (llvm::IntegerType *iTy =
-                  dyn_cast<llvm::IntegerType>(elementType)) {
+          if (isa<llvm::IntegerType>(elementType)) {
             if (llvm::ConstantInt *ci = dyn_cast<llvm::ConstantInt>(child)) {
               if (ci->getBitWidth() == 8) {
                 SmallVector<int8_t> constants(numElements, ci->getZExtValue());



More information about the Mlir-commits mailing list