Skip to content

[ThinLTO]Clean up 'import-assume-unique-local' flag. #102424

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@
// RUN: -g -flto=thin -fwhole-program-vtables -fno-split-lto-unit -O2 \
// RUN: -mllvm -enable-vtable-value-profiling -Wl,-mllvm,-enable-vtable-value-profiling \
// RUN: -mllvm -enable-vtable-profile-use \
// RUN: -Wl,-plugin-opt,-import-assume-unique-local \
// RUN: -Wl,-mllvm,-enable-vtable-profile-use -Rpass=pgo-icall-prom \
// RUN: -Wl,-mllvm,-print-after=pgo-icall-prom \
// RUN: -Wl,-mllvm,-filter-print-funcs=main lib.cpp main.cpp 2>&1 \
Expand Down
16 changes: 2 additions & 14 deletions llvm/lib/Transforms/IPO/FunctionImport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,17 +174,6 @@ static cl::opt<std::string> WorkloadDefinitions(
"}"),
cl::Hidden);

static cl::opt<bool> ImportAssumeUniqueLocal(
"import-assume-unique-local", cl::init(false),
cl::desc(
"By default, a local-linkage global variable won't be imported in the "
"edge mod1:func -> mod2:local-var (from value profiles) since compiler "
"cannot assume mod2 is compiled with full path which gives local-var a "
"program-wide unique GUID. Set this option to true will help cross "
"module import of such variables. This is only safe if the compiler "
"user specify the full module path."),
cl::Hidden);

static cl::opt<std::string>
ContextualProfile("thinlto-pgo-ctx-prof",
cl::desc("Path to a contextual profile."), cl::Hidden);
Expand Down Expand Up @@ -214,9 +203,8 @@ static std::unique_ptr<Module> loadFile(const std::string &FileName,
static bool shouldSkipLocalInAnotherModule(const GlobalValueSummary *RefSummary,
size_t NumDefs,
StringRef ImporterModule) {
// We can import a local from another module if all inputs are compiled
// with full paths or when there is one definition.
if (ImportAssumeUniqueLocal || NumDefs == 1)
// We can import a local when there is one definition.
if (NumDefs == 1)
return false;
// In other cases, make sure we import the copy in the caller's module if the
// referenced value has local linkage. The only time a local variable can
Expand Down
Loading