[PATCH] D156845: [ConstantRange] Calculate precise range for shl by -1

Noah Goldstein via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 10 08:36:59 PDT 2023


goldstein.w.n added inline comments.


================
Comment at: llvm/lib/IR/ConstantRange.cpp:1484
+    Neg = true;
+  }
+
----------------
`bool Neg = getSingleElement && isAllNegative();`


================
Comment at: llvm/lib/IR/ConstantRange.cpp:1499
+    std::swap(Min, Max);
+  }
   return ConstantRange::getNonEmpty(std::move(Min), std::move(Max) + 1);
----------------
(style)
```
// Comment
if (Neg)
   std::swap(...)
```


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D156845/new/

https://reviews.llvm.org/D156845



More information about the llvm-commits mailing list