================
@@ -1035,6 +1043,13 @@ void EmitAssemblyHelper::RunOptimizationPipeline(
     }
   }
 
+  // Re-link against any bitcodes supplied via the -mlink-builtin-bitcode 
option
+  // Some optimizations may generate new function calls that would not have
+  // been linked pre-optimization (i.e. fused sincos calls generated by
+  // AMDGPULibCalls::fold_sincos.)
+  if (ClRelinkBuiltinBitcodePostop)
----------------
jhuber6 wrote:

So, what I had in mind is that we could make a new `clang` option similar to 
`-mlink-builtin-bitcode`. This would then be used by the HIP toolchain or 
similar when constructing the list of files to pass via 
`-mlink-builtin-bitcode`. We would then simply register those with this 
secondary pass.

This approach seems much simpler, being a boolean option that just relinks 
everything, but I somewhat like the idea of `-mlink-builtin-bitcode` being a 
pre-link operation and having another one for post-linking. That being said, it 
may not be worth the extra work because this is a huge hack around this 
ecosystem already.

https://github.com/llvm/llvm-project/pull/69371
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to