[Mlir-commits] [mlir] 267be4a - [MLIR] Reference issue for implicit trunc TODOs (NFC)
Nikita Popov
llvmlistbot at llvm.org
Thu Oct 17 00:04:00 PDT 2024
Author: Nikita Popov
Date: 2024-10-17T09:03:39+02:00
New Revision: 267be4a7f4ac69cfd1bec5223554bbe400c5636c
URL: https://github.com/llvm/llvm-project/commit/267be4a7f4ac69cfd1bec5223554bbe400c5636c
DIFF: https://github.com/llvm/llvm-project/commit/267be4a7f4ac69cfd1bec5223554bbe400c5636c.diff
LOG: [MLIR] Reference issue for implicit trunc TODOs (NFC)
Added:
Modified:
mlir/include/mlir/IR/BuiltinAttributes.td
mlir/lib/IR/Builders.cpp
Removed:
################################################################################
diff --git a/mlir/include/mlir/IR/BuiltinAttributes.td b/mlir/include/mlir/IR/BuiltinAttributes.td
index 530ba7d2f11e5c..492b8309a5ea33 100644
--- a/mlir/include/mlir/IR/BuiltinAttributes.td
+++ b/mlir/include/mlir/IR/BuiltinAttributes.td
@@ -702,6 +702,7 @@ def Builtin_IntegerAttr : Builtin_Attr<"Integer", "integer",
}
// TODO: Avoid implicit trunc?
+ // See https://github.com/llvm/llvm-project/issues/112510.
IntegerType intTy = ::llvm::cast<IntegerType>(type);
APInt apValue(intTy.getWidth(), value, intTy.isSignedInteger(),
/*implicitTrunc=*/true);
diff --git a/mlir/lib/IR/Builders.cpp b/mlir/lib/IR/Builders.cpp
index 5359432a04f3e5..5397fbabc5c95e 100644
--- a/mlir/lib/IR/Builders.cpp
+++ b/mlir/lib/IR/Builders.cpp
@@ -269,6 +269,7 @@ IntegerAttr Builder::getIntegerAttr(Type type, int64_t value) {
if (type.isIndex())
return IntegerAttr::get(type, APInt(64, value));
// TODO: Avoid implicit trunc?
+ // See https://github.com/llvm/llvm-project/issues/112510.
return IntegerAttr::get(type, APInt(type.getIntOrFloatBitWidth(), value,
type.isSignedInteger(),
/*implicitTrunc=*/true));
More information about the Mlir-commits
mailing list