From acda808304e32d1cf51d520e8710cbb7362fc961 Mon Sep 17 00:00:00 2001 From: Mehdi Amini Date: Thu, 21 Aug 2025 12:31:18 +0200 Subject: [PATCH] [MLIR] Adopt LDBG() macro in BuiltinAttributes.cpp (NFC) (#154723) --- mlir/lib/IR/BuiltinAttributes.cpp | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/mlir/lib/IR/BuiltinAttributes.cpp b/mlir/lib/IR/BuiltinAttributes.cpp index fd898b7493c7..6f880f810d65 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 @@ -1119,9 +1120,8 @@ static bool isValidIntOrFloat(Type type, int64_t dataEltSize, bool isInt, auto denseEltBitWidth = getDenseElementBitWidth(type); auto dataSize = static_cast(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(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(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; }