================ @@ -19,20 +19,20 @@ using namespace llvm; static bool finalizeLinkage(Module &M) { - SmallPtrSet<Function *, 8> EntriesAndExports; + SmallPtrSet<Function *, 8> Funcs; // Find all entry points and export functions for (Function &EF : M.functions()) { - if (!EF.hasFnAttribute("hlsl.shader") && !EF.hasFnAttribute("hlsl.export")) + if (EF.hasFnAttribute("hlsl.shader") || EF.hasFnAttribute("hlsl.export")) continue; - EntriesAndExports.insert(&EF); + Funcs.insert(&EF); } - for (Function &F : M.functions()) { - if (F.getLinkage() == GlobalValue::ExternalLinkage && - !EntriesAndExports.contains(&F)) { - F.setLinkage(GlobalValue::InternalLinkage); - } + for (Function *F : Funcs) { + if (F->getLinkage() == GlobalValue::ExternalLinkage) + F->setLinkage(GlobalValue::InternalLinkage); + if (F->hasFnAttribute(Attribute::AlwaysInline) && F->isDefTriviallyDead()) ---------------- hekota wrote:
Could these tests be updated to use `export` keyword to preserve the functions? https://github.com/llvm/llvm-project/pull/106146 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits