[clang] [llvm] [NVPTX] Revamp NVVMIntrRange pass (PR #94422)

Artem Belevich via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 5 11:46:57 PDT 2024


================
@@ -128,6 +128,15 @@ bool findOneNVVMAnnotation(const GlobalValue *gv, const std::string &prop,
   return true;
 }
 
+static std::optional<unsigned>
+findOneNVVMAnnotation(const GlobalValue &GV, const std::string &PropName) {
+  unsigned RetVal;
+  bool Found = findOneNVVMAnnotation(&GV, PropName, RetVal);
+  if (Found)
+    return RetVal;
----------------
Artem-B wrote:

Could be collapsed into 
```
  if (findOneNVVMAnnotation(&GV, PropName, RetVal))
    return RetVal;
```

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


More information about the llvm-commits mailing list