Skip to content

Commit

Permalink
PassWrapper: handle function rename from upstream D36850
Browse files Browse the repository at this point in the history
thinLTOResolvePrevailingInModule became thinLTOFinalizeInModule and
gained the ability to propagate noRecurse and noUnwind function
attributes. I ran codegen tests with it both on and off, as the upstream
patch uses it in both modes, and the tests pass both ways. Given that,
it seemed reasonable to go ahead and let the propagation be enabled in
rustc, and see what happens. See https://reviews.llvm.org/D36850 for
more examples of how the new version of the function gets used.
  • Loading branch information
durin42 committed Sep 27, 2021
1 parent 2b6ed3b commit 12c3f50
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1572,7 +1572,11 @@ extern "C" bool
LLVMRustPrepareThinLTOResolveWeak(const LLVMRustThinLTOData *Data, LLVMModuleRef M) {
Module &Mod = *unwrap(M);
const auto &DefinedGlobals = Data->ModuleToDefinedGVSummaries.lookup(Mod.getModuleIdentifier());
#if LLVM_VERSION_GE(14, 0)
thinLTOFinalizeInModule(Mod, DefinedGlobals, /*PropagateAttrs=*/true);
#else
thinLTOResolvePrevailingInModule(Mod, DefinedGlobals);
#endif
return true;
}

Expand Down

0 comments on commit 12c3f50

Please sign in to comment.