Changed the underlying offset and comparisons to use int64_t instead of uint64_t
Details
Diff Detail
Event Timeline
I would avoid using an in-band value as a sentinel, there can be unintended consequences. Consider what happens when the GEP index is 9223372036854775807.
Instead, I'd use a separate bool indicating that PrevOffset holds a good value or make PrevOffset an Optional.
/Users/rriddle/Desktop/llvm/llvm/lib/Transforms/Scalar/LoadCombine.cpp | ||
---|---|---|
141 | While I know of no platform that LLVM supports where LLONG_MAX != INT64_MAX, we would still prefer INT64_MAX. | |
142 | Hmm, any reason why PrevSize had to become an int64_t ? | |
/Users/rriddle/Desktop/llvm/llvm/test/Transforms/LoadCombine/load-combine-negativegep.ll | ||
1 | Please don't run instcombine, we try to minimize the number of passes involved in each test. |
Fixed the size type change mistake. Changed the iteration variable to be a separate value.
Hey David, This is my first patch so Im not too sure about the process for committing. Accordingly, Im fairly certain that I don't have commit access.
Thanks River
While I know of no platform that LLVM supports where LLONG_MAX != INT64_MAX, we would still prefer INT64_MAX.