https://github.com/efriedma-quic commented: Probably worth investigating if we can fit this easily into some pass that's already examining the uses of globals, like GlobalOpt; iterating over the whole module isn't cheap. https://github.com/llvm/llvm-project/pull/107120