[PATCH] D92648: [DSE][NFC] Need to be carefull mixing signed and unsigned types
Florian Hahn via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Dec 7 14:00:45 PST 2020
fhahn accepted this revision.
fhahn added a comment.
This revision is now accepted and ready to land.
LGTM, using an unsigned type for the sizes seems a good improvement to me.
================
Comment at: llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp:1136
int64_t LaterStart = OII->second;
- int64_t LaterSize = OII->first - LaterStart;
-
- if (LaterStart > EarlierStart && LaterStart < EarlierStart + EarlierSize &&
- LaterStart + LaterSize >= EarlierStart + EarlierSize) {
+ uint64_t LaterSize = OII->first - LaterStart;
+
----------------
might be worth adding an assertion here to ensure that `LaterSize` will be positive, but it might be too cautious.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D92648/new/
https://reviews.llvm.org/D92648
More information about the llvm-commits
mailing list