[llvm] [NVPTX] Cleanup/Refactoring in NVPTX AsmPrinter and RegisterInfo (NFC) (PR #126800)

Alex MacLean via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 12 00:22:06 PST 2025


================
@@ -635,25 +635,23 @@ static bool usedInGlobalVarDef(const Constant *C) {
   return false;
 }
 
-static bool usedInOneFunc(const User *U, Function const *&oneFunc) {
-  if (const GlobalVariable *othergv = dyn_cast<GlobalVariable>(U)) {
-    if (othergv->getName() == "llvm.used")
+static bool usedInOneFunc(const User *U, Function const *&OneFunc) {
----------------
AlexMaclean wrote:

I gave this a go but unfortunately replicating the logic with std::optional ends up being a bit cumbersome and slightly longer than the current version. I'm leaving this unchanged for now. 

https://github.com/llvm/llvm-project/pull/126800


More information about the llvm-commits mailing list