The current implementation of function internalization creats a copy of each
function and replaces every use. This has the downside that the external
versions of the functions will call into the internalized versions of the
functions. This prevents them from being fully independent of eachother. This
patch replaces the current internalization scheme with a method that creates
all the copies of the functions intended to be internalized first and then
replaces the uses as long as their caller is not already internalized.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
Note: this seems to break some Attributor and AMDGPU Attributor tests. Attributor doesn't internalize by default. Maybe it is breaking that.
But I don't know why.
llvm/lib/Transforms/IPO/Attributor.cpp | ||
---|---|---|
1946 | Rather than doing this lookup can we pass in DenseMap<Function *, Function *> InternalizedFns and use it to lookup the new copy. | |
1959 | Move to use to shorten the lifetime. | |
2001–2003 | ||
2006 | Why here? Move this to the actual internalization, no? |
Rather than doing this lookup can we pass in DenseMap<Function *, Function *> InternalizedFns and use it to lookup the new copy.
More useful in the future too as it allows to lookup all copies.