[PATCH] D32373: [PartialInliner] Do not do partial inlining for functions with non-call references
Davide Italiano via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 21 14:19:39 PDT 2017
davide accepted this revision.
davide added a comment.
This revision is now accepted and ready to land.
Yes, I was reducing the same. Some comments, but I had the same fix.
Are you running with `-O3` or LTO? Where are you putting the inliner?
================
Comment at: lib/Transforms/IPO/PartialInlining.cpp:89
+ auto canAllUsesBeReplaced = [](Function *F) {
+ std::vector<User *> Users(F->user_begin(), F->user_end());
+ for (User *User : Users) {
----------------
`SmallVector<>` maybe? (up to you)
================
Comment at: lib/Transforms/IPO/PartialInlining.cpp:96-97
+ Callee = CallSite(II).getCalledFunction();
+ else
+ return false;
+ if (Callee != F)
----------------
Is this bit needed?
I assume the invariant `F != nullptr` should always hold, at which point if we don't set Callee, so `Callee != F` is always true and we return false.
Does it make sense to you?
https://reviews.llvm.org/D32373
More information about the llvm-commits
mailing list