lamb-j wrote:

> This approach assumes that whatever the function call was transformed into 
> also exists in the same library, which isn't necessarily true.

True, good point. But I don't think it's necessarily due to this approach, but 
more of how AMDGPULibCalls is implemented. It seems like the instruction 
folding implementations are assuming the definitions of the new functions 
they're inserting will be linked in at a later point?

Previously we were doing it via a separate _llvm-link_ call to re-link all the 
device libraries. With this approach, we're doing it as part of the clang 
optimization pipeline, and would no longer need that extra link step.

Maybe this approach could be a solution for the time being? With a longer term 
solution being to think more carefully about the legality of AMDGPULibCalls 
inserting function calls that may or may not exist? Maybe device library calls 
are the exception?



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