[PATCH] D59218: [LSR] Fix signed overflow in GenerateCrossUseConstantOffsets.
Eli Friedman via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Mar 25 14:44:49 PDT 2019
efriedma added inline comments.
================
Comment at: llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp:4142
+ // First + Last = 2 * (First + Last) + (First ^ Last).
+ Imms.lower_bound((First & Last) + (First ^ Last) / 2)};
for (size_t i = 0, e = array_lengthof(OtherImms); i != e; ++i) {
----------------
Are you sure this formula is right? Alive says it doesn't work correctly for signed values: https://rise4fun.com/Alive/E3V.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D59218/new/
https://reviews.llvm.org/D59218
More information about the llvm-commits
mailing list