[PATCH] D30651: [InlineCost, -Oz] Don't take into account the penalty of a fast call of frequently used functions
Eli Friedman via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Mar 10 15:37:36 PST 2017
efriedma added a comment.
> I guess if it was not a loop GEP would have been folded into a load/store instruction. Anyway the cost calculation for GEP is not correct.
> Maybe instead of 'return true' it should be 'return isGEPFree(I);'. Then TTI::getGEPCost would return it is not free.
Oh, the inliner has its own equivalent? Anyway, that isn't really the point; the point is that we're concluding the GEP is free because we're assuming the users of the GEP are loads and stores, rather than PHI nodes/calls/etc.
>> Not sure how relevant that is in practice, though.
> Do you mean the IR code I provided? This is what a naive memcopy function is translated into.
Sorry, wasn't clear there; I mean, it obviously triggers in a substantial number of cases, but it probably doesn't actually change the inline cost enough to matter in most cases.
https://reviews.llvm.org/D30651
More information about the llvm-commits
mailing list