[PATCH] D65417: [SCCP] Update condition to avoid overflow.
Sanjoy Das (Work Account) via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 30 15:11:33 PDT 2019
sanjoy.google added inline comments.
================
Comment at: lib/Analysis/ConstantFolding.cpp:551
// If we're not accessing anything in this constant, the result is undefined.
- if (Offset >= InitializerSize)
+ if (Offset <= (int64_t)-1 * BytesLoaded)
return UndefValue::get(IntType);
----------------
Use `static_cast`? That also makes it obvious whether the cast happens before or after the multiply.
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D65417/new/
https://reviews.llvm.org/D65417
More information about the llvm-commits
mailing list