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

llvmlistbot at llvm.org llvmlistbot at llvm.org
Fri Jul 5 04:31:00 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-mlir-llvm

Author: Mats Petersson (Leporacanthicus)

<details>
<summary>Changes</summary>

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.

---
Full diff: https://github.com/llvm/llvm-project/pull/97813.diff


1 Files Affected:

- (modified) mlir/lib/Target/LLVMIR/ModuleTranslation.cpp (+1-2) 


``````````diff
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());

``````````

</details>


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


More information about the Mlir-commits mailing list