[PATCH] D59450: [ValueTracking] Use ConstantRange overflow check for signed add (NFC)

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Mar 17 03:08:44 PDT 2019


lebedev.ri added inline comments.


================
Comment at: llvm/lib/Analysis/ValueTracking.cpp:4104-4105
+  APInt Lower = Known.One, Upper = ~Known.Zero;
+  Lower.setSignBit();
+  Upper.clearSignBit();
+  return ConstantRange(Lower, Upper + 1);
----------------
This seems like the only non-obvious place here.
There are tests that will fail if it is written **any** other way?


Repository:
  rL LLVM

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

https://reviews.llvm.org/D59450





More information about the llvm-commits mailing list