[PATCH] D117092: [GlobalOpt] Use generic type when converting malloc to global
Philip Reames via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Jan 14 08:10:59 PST 2022
reames accepted this revision.
reames added a comment.
This revision is now accepted and ready to land.
LGTM with minor comments.
================
Comment at: llvm/lib/Transforms/IPO/GlobalOpt.cpp:1015
+ uint64_t AllocSize;
+ if (!getObjectSize(CI, AllocSize, DL, TLI, ObjectSizeOpts()))
+ return false;
----------------
I think we also want the size > 0 guard. I don't believe that case is reachable for any of our current allocators, but if we generalizing..
================
Comment at: llvm/lib/Transforms/IPO/GlobalOpt.cpp:1112
- // If we have a global that is only initialized with a fixed size malloc,
- // transform the program to use global memory instead of malloc'd memory.
----------------
Please add back the first part of this comment.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D117092/new/
https://reviews.llvm.org/D117092
More information about the llvm-commits
mailing list