[Mlir-commits] [mlir] [MLIR] Adopt LDBG() macro in BuiltinAttributes.cpp (NFC) (PR #154723)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Thu Aug 21 03:23:26 PDT 2025
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-mlir-core
Author: Mehdi Amini (joker-eph)
<details>
<summary>Changes</summary>
---
Full diff: https://github.com/llvm/llvm-project/pull/154723.diff
1 Files Affected:
- (modified) mlir/lib/IR/BuiltinAttributes.cpp (+6-11)
``````````diff
diff --git a/mlir/lib/IR/BuiltinAttributes.cpp b/mlir/lib/IR/BuiltinAttributes.cpp
index fd898b7493c7f..6f880f810d651 100644
--- a/mlir/lib/IR/BuiltinAttributes.cpp
+++ b/mlir/lib/IR/BuiltinAttributes.cpp
@@ -19,6 +19,7 @@
#include "mlir/IR/Types.h"
#include "llvm/ADT/APSInt.h"
#include "llvm/Support/Debug.h"
+#include "llvm/Support/DebugLog.h"
#include "llvm/Support/Endian.h"
#include <optional>
@@ -1119,9 +1120,8 @@ static bool isValidIntOrFloat(Type type, int64_t dataEltSize, bool isInt,
auto denseEltBitWidth = getDenseElementBitWidth(type);
auto dataSize = static_cast<size_t>(dataEltSize * CHAR_BIT);
if (denseEltBitWidth != dataSize) {
- LLVM_DEBUG(llvm::dbgs() << "expected dense element bit width "
- << denseEltBitWidth << " to match data size "
- << dataSize << " for type " << type << "\n");
+ LDBG() << "expected dense element bit width " << denseEltBitWidth
+ << " to match data size " << dataSize << " for type " << type;
return false;
}
@@ -1129,9 +1129,7 @@ static bool isValidIntOrFloat(Type type, int64_t dataEltSize, bool isInt,
if (!isInt) {
bool valid = llvm::isa<FloatType>(type);
if (!valid)
- LLVM_DEBUG(llvm::dbgs()
- << "expected float type when isInt is false, but found "
- << type << "\n");
+ LDBG() << "expected float type when isInt is false, but found " << type;
return valid;
}
if (type.isIndex())
@@ -1139,9 +1137,7 @@ static bool isValidIntOrFloat(Type type, int64_t dataEltSize, bool isInt,
auto intType = llvm::dyn_cast<IntegerType>(type);
if (!intType) {
- LLVM_DEBUG(llvm::dbgs()
- << "expected integer type when isInt is true, but found " << type
- << "\n");
+ LDBG() << "expected integer type when isInt is true, but found " << type;
return false;
}
@@ -1151,8 +1147,7 @@ static bool isValidIntOrFloat(Type type, int64_t dataEltSize, bool isInt,
bool valid = intType.isSigned() == isSigned;
if (!valid)
- LLVM_DEBUG(llvm::dbgs() << "expected signedness " << isSigned
- << " to match type " << type << "\n");
+ LDBG() << "expected signedness " << isSigned << " to match type " << type;
return valid;
}
``````````
</details>
https://github.com/llvm/llvm-project/pull/154723
More information about the Mlir-commits
mailing list