Skip to content

Commit d8b04e6

Browse files
committed
fixup! [MLIR][LLVM] Fix #llvm.constant_range crashing in storage uniquer
1 parent 8b59fe5 commit d8b04e6

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

mlir/include/mlir/Dialect/LLVMIR/LLVMAttrDefs.td

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1094,7 +1094,8 @@ def LLVM_TBAATagArrayAttr
10941094
// ConstantRangeAttr
10951095
//===----------------------------------------------------------------------===//
10961096
def LLVM_ConstantRangeAttr : LLVM_Attr<"ConstantRange", "constant_range"> {
1097-
let parameters = (ins APIntParameter<"">:$lower,
1097+
let parameters = (ins
1098+
APIntParameter<"">:$lower,
10981099
APIntParameter<"">:$upper
10991100
);
11001101
let summary = "A range of two integers, corresponding to LLVM's ConstantRange";

mlir/include/mlir/IR/AttrTypeBase.td

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,9 @@ class StringRefParameter<string desc = "", string value = ""> :
383383
let defaultValue = value;
384384
}
385385

386-
// For APInts, which require comparison over different bitwidths
386+
// For APInts, which require comparison supporting different bitwidths. The
387+
// default APInt comparison operator asserts when the bitwidths differ, so
388+
// a custom implementation is necessary.
387389
class APIntParameter<string desc> :
388390
AttrOrTypeParameter<"::llvm::APInt", desc> {
389391
let comparator = "$_lhs.getBitWidth() == $_rhs.getBitWidth() && $_lhs == $_rhs";

0 commit comments

Comments
 (0)