diff --git a/mlir/lib/Dialect/Arithmetic/IR/ArithmeticOps.cpp b/mlir/lib/Dialect/Arithmetic/IR/ArithmeticOps.cpp --- a/mlir/lib/Dialect/Arithmetic/IR/ArithmeticOps.cpp +++ b/mlir/lib/Dialect/Arithmetic/IR/ArithmeticOps.cpp @@ -95,10 +95,10 @@ if (intType && intType.getWidth() == 1) return setNameFn(getResult(), (intCst.getInt() ? "true" : "false")); - // Otherwise, build a compex name with the value and type. + // Otherwise, build a complex name with the value and type. SmallString<32> specialNameBuffer; llvm::raw_svector_ostream specialName(specialNameBuffer); - specialName << 'c' << intCst.getInt(); + specialName << 'c' << intCst.getValue(); if (intType) specialName << '_' << type; setNameFn(getResult(), specialName.str()); diff --git a/mlir/test/Dialect/Arithmetic/ops.mlir b/mlir/test/Dialect/Arithmetic/ops.mlir --- a/mlir/test/Dialect/Arithmetic/ops.mlir +++ b/mlir/test/Dialect/Arithmetic/ops.mlir @@ -924,6 +924,12 @@ // CHECK: %false = arith.constant false %8 = arith.constant false + // CHECK: %c-1_i128 = arith.constant -1 : i128 + %9 = arith.constant 340282366920938463463374607431768211455 : i128 + + // CHECK: %c85070591730234615865843651857942052864_i128 = arith.constant 85070591730234615865843651857942052864 : i128 + %10 = arith.constant 85070591730234615865843651857942052864 : i128 + return }