[Mlir-commits] [mlir] [MLIR][NVVM] Fixed assertion failure for insufficient parsing validation of nvvm dialect PureSpecialRangeableRegisterOp (PR #163434)
Mehdi Amini
llvmlistbot at llvm.org
Tue Oct 14 12:29:11 PDT 2025
================
@@ -279,6 +280,23 @@ class NVVM_PureSpecialRangeableRegisterOp<string mnemonic, list<Trait> traits =
SetIntRangeFn setResultRanges) {
nvvmInferResultRanges(getOperation(), getResult(), argRanges, setResultRanges);
}
+
+ // Verify the range attribute satisfies LLVM ConstantRange constructor requirements.
+ ::llvm::LogicalResult $cppClass::verify() {
+ auto rangeAttr = getRange();
+ if (!rangeAttr)
+ return ::mlir::success(); // No range specified, validation passes
+
+ const ::llvm::APInt &lower = rangeAttr->getLower();
+ const ::llvm::APInt &upper = rangeAttr->getUpper();
+
+ // Check LLVM ConstantRange constructor condition
+ if (!(lower != upper || (lower.isMaxValue() || lower.isMinValue()))) {
+ return emitOpError("invalid range attribute: range must be a valid constant range");
----------------
joker-eph wrote:
I would add more information on what the criteria is and also print the lower and upper values.
https://github.com/llvm/llvm-project/pull/163434
More information about the Mlir-commits
mailing list