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

Artem Belevich via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 11 16:51:20 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) {
----------------
Artem-B wrote:

`return bool + value via argument` may be converted to returning std::optional.

Definitely easier to grok than `const *& something`.

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


More information about the llvm-commits mailing list