[clang] Correctly link and optimize device libraries with -mlink-builtin-bitcode (PR #69371)
Joseph Huber via cfe-commits
cfe-commits at lists.llvm.org
Mon Nov 6 10:43:26 PST 2023
================
@@ -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:
It's definitely the easier option. This problem is pretty specific, but I can see it being easier to just remove this class of bugs entirely. It's an ugly solution for an ugly problem overall.
https://github.com/llvm/llvm-project/pull/69371
More information about the cfe-commits
mailing list