[clang] [clang][CodeGen] Omit pre-opt link when post-opt is link requested (PR #85672)

Jacob Lambert via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 29 11:29:07 PDT 2024


================
@@ -28,12 +28,8 @@ PreservedAnalyses LinkInModulesPass::run(Module &M, ModuleAnalysisManager &AM) {
   if (!BC)
     return PreservedAnalyses::all();
 
-  // Re-load bitcode modules from files
-  if (BC->ReloadModules(&M))
-    report_fatal_error("Bitcode module re-loading failed, aborted!");
-
   if (BC->LinkInModules(&M, ShouldLinkFiles))
-    report_fatal_error("Bitcode module re-linking failed, aborted!");
+    report_fatal_error("Bitcode module postopt linking failed, aborted!");
 
-  return PreservedAnalyses::all();
----------------
lamb-j wrote:

This should fix the issue:

LLVM ERROR: Function @_Z6sincosfPU3AS5f changed by LinkInModulesPass without invalidating analyses

https://github.com/llvm/llvm-project/pull/85672


More information about the cfe-commits mailing list