[PATCH] D120136: [ConstantRange] Construct constant range from xor operation

Joseph Faulls via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 21 05:04:57 PST 2022


Joe added inline comments.


================
Comment at: llvm/lib/IR/ConstantRange.cpp:1429
+  const APInt OtherMin = Other.getSignedMin();
+  const APInt OtherMax = Other.getSignedMax();
+  if (Min.isNegative() == Max.isNegative() &&
----------------
nikic wrote:
> I don't understand how signedness is relevant here. Can't you use Lower and Upper-1 here, independent of signedness?
The call to getSignedMin/Max includes a check of isFullSet and isUpperSignWrapped, which is relevant here, otherwise Upper-1 would not work.


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

https://reviews.llvm.org/D120136



More information about the llvm-commits mailing list