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
Unit Tests
Unit Tests
Time | Test | |
---|---|---|
3,500 ms | x64 debian > libarcher.races::lock-unrelated.c |
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 | ||
---|---|---|
1945 | Rather than doing this lookup can we pass in DenseMap<Function *, Function *> InternalizedFns and use it to lookup the new copy. | |
1958 | Move to use to shorten the lifetime. | |
2000–2002 | ||
2005 | Why here? Move this to the actual internalization, no? |
clang-tidy: warning: twine variables are prone to use-after-free bugs [llvm-twine-local]
not useful