[all-commits] [llvm/llvm-project] b14be1: [SCEV] Use object size for globals to sharpen ranges.
Florian Hahn via All-commits
all-commits at lists.llvm.org
Sat Apr 29 13:33:58 PDT 2023
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: b14be1e7c0530c3c82e965104f160a4b357f91ed
https://github.com/llvm/llvm-project/commit/b14be1e7c0530c3c82e965104f160a4b357f91ed
Author: Florian Hahn <flo at fhahn.com>
Date: 2023-04-29 (Sat, 29 Apr 2023)
Changed paths:
M llvm/lib/Analysis/ScalarEvolution.cpp
M llvm/test/Analysis/ScalarEvolution/incorrect-exit-count.ll
M llvm/test/Analysis/ScalarEvolution/load.ll
M llvm/test/Analysis/ScalarEvolution/ptrtoint-global.ll
M llvm/test/Transforms/IndVarSimplify/ptrtoint-global-cmp.ll
Log Message:
-----------
[SCEV] Use object size for globals to sharpen ranges.
The highest address the object can start is ObjSize bytes before the
end (unsigned max value). If this value is not a multiple of the
alignment, the last possible start value is the next lowest multiple
of the alignment. Note: The computations cannot overflow,
because if they would there's no possible start address for the
object.
At the moment, this is limited to GlobalVariables, because I could not
find a API similar to getObjectSize to also get the alignment of the
object. With such an API, this can be generalized to general addresses.
Reviewed By: nikic
Differential Revision: https://reviews.llvm.org/D149483
More information about the All-commits
mailing list