[Mlir-commits] [mlir] [mlir] IntegerRangeAnalysis: add support for vector type (PR #112292)

Andrzej WarzyƄski llvmlistbot at llvm.org
Mon Oct 28 10:30:39 PDT 2024


================
@@ -35,10 +35,27 @@ convertArithOverflowFlags(arith::IntegerOverflowFlags flags) {
 
 void arith::ConstantOp::inferResultRanges(ArrayRef<ConstantIntRanges> argRanges,
                                           SetIntRangeFn setResultRange) {
-  auto constAttr = llvm::dyn_cast_or_null<IntegerAttr>(getValue());
-  if (constAttr) {
+  if (auto constAttr = llvm::dyn_cast_or_null<IntegerAttr>(getValue())) {
     const APInt &value = constAttr.getValue();
     setResultRange(getResult(), ConstantIntRanges::constant(value));
+    return;
+  }
+  if (auto constAttr =
----------------
banach-space wrote:

```suggestion
  if (auto arrayCstAttr =
```

https://github.com/llvm/llvm-project/pull/112292


More information about the Mlir-commits mailing list