[llvm] [KernelInfo] Implement new LLVM IR pass for GPU code analysis (PR #102944)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Sun Sep 15 03:06:20 PDT 2024


================
@@ -338,6 +338,11 @@ class TargetSubtargetInfo : public MCSubtargetInfo {
   /// the pass, with architecture specific overrides providing the information
   /// where they are implemented.
   virtual bool supportsInitUndef() const { return false; }
+
+  /// For \p F, call \p Body with the name and value of each launch bound.
+  virtual void forEachLaunchBound(
+      const Function &F,
+      std::function<void(StringRef Name, unsigned Value)> Body) const {}
----------------
arsenm wrote:

It would be more appropriate to add something to TargetTransformInfo. It also needs a more specific name and documentation comment. Also should use int64_t for arbitrary integer values 

This can also be function_ref 

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


More information about the llvm-commits mailing list