Skip to content

Commit

Permalink
[MLIR] Reference issue for implicit trunc TODOs (NFC)
Browse files Browse the repository at this point in the history
  • Loading branch information
nikic committed Oct 17, 2024
1 parent 255a99c commit 267be4a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions mlir/include/mlir/IR/BuiltinAttributes.td
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
1 change: 1 addition & 0 deletions mlir/lib/IR/Builders.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down

0 comments on commit 267be4a

Please sign in to comment.