sivadeilra wrote: Ok, I've redone the code that modifies GlobalVariable references. It is more complicated, but that was necessary to handle constant expressions. There are detailed comments in the code, so I'll let those comments speak for themselves.
Fixed a bug in how the `__ref_*` variables were created. They were being created as constants, but that's incorrect; it allows the optimizer to read the initializer / definition and then inline it into places that use the GV. That defeats the whole purpose of the redirection mechanism. I've changed the variables so that they are non-constant. Fixed a bug where the `__ref_*` variables were marked for internal linkage. They need to be external-but-weak. https://github.com/llvm/llvm-project/pull/138972 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits